2021-02-26 00:28:51 +00:00
|
|
|
name: Publish Docker image
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: main
|
|
|
|
tags:
|
|
|
|
- '*'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
push_to_registry:
|
|
|
|
name: Push Docker image to GitHub Packages
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Check out the repo
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Push to GitHub Packages
|
|
|
|
uses: docker/build-push-action@v1
|
|
|
|
with:
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
repository: ${{ github.repository }}/${{ github.event.repository.name }}
|
|
|
|
registry: docker.pkg.github.com
|
|
|
|
tag_with_ref: true
|
2021-11-24 23:25:13 +00:00
|
|
|
- name: Deploy
|
|
|
|
uses: appleboy/ssh-action@master
|
|
|
|
with:
|
|
|
|
host: ${{ secrets.HOST }}
|
|
|
|
username: ${{ secrets.USERNAME }}
|
|
|
|
key: ${{ secrets.KEY }}
|
|
|
|
script: |
|
|
|
|
docker compose pull twigs
|
|
|
|
docker compose up -d --build twigs
|
|
|
|
docker image prune -f
|