mirror of
https://github.com/yanislav-igonin/micrach
synced 2024-12-22 22:32:33 +03:00
feat: add deploy stage
This commit is contained in:
parent
3a841dea4a
commit
2af6b754c8
22
.github/workflows/push.yml
vendored
22
.github/workflows/push.yml
vendored
@ -42,3 +42,25 @@ jobs:
|
|||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
tags: latest
|
tags: latest
|
||||||
# build_args: CI_COMMIT_TAG=${{ github.event.release.tag_name }}
|
# build_args: CI_COMMIT_TAG=${{ github.event.release.tag_name }}
|
||||||
|
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
needs: release
|
||||||
|
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Deploy
|
||||||
|
uses: appleboy/ssh-action@master
|
||||||
|
env:
|
||||||
|
REGISTRY: ghcr.io/yanislav-igonin/micrach-go/micrach
|
||||||
|
SERVICE_NAME: micrach_app
|
||||||
|
with:
|
||||||
|
host: ${{ secrets.VPS_HOST }}
|
||||||
|
username: ${{ secrets.VPS_SSH_USERNAME }}
|
||||||
|
key: ${{ secrets.VPS_SSH_PRIVATE_KEY }}
|
||||||
|
script: |
|
||||||
|
docker login -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }} ${{ env.REGISTRY }}
|
||||||
|
docker pull ${{ env.REGISTRY }}:${{ github.event.release.tag_name }}
|
||||||
|
docker pull ${{ env.REGISTRY }}:latest
|
||||||
|
docker service update --image ${{ env.REGISTRY }}:${{ github.event.release.tag_name }} ${{ env.SERVICE_NAME }}
|
Loading…
Reference in New Issue
Block a user