From 8b8efc116136cd3524387e788f713d9b512e1911 Mon Sep 17 00:00:00 2001 From: Mateusz Skoczek Date: Tue, 24 Sep 2024 13:03:52 +0200 Subject: [PATCH] Update master_push.yml --- .github/workflows/master_push.yml | 33 +++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/.github/workflows/master_push.yml b/.github/workflows/master_push.yml index 139f020..0d760ac 100644 --- a/.github/workflows/master_push.yml +++ b/.github/workflows/master_push.yml @@ -89,3 +89,36 @@ jobs: release_name: ${{needs.publish.outputs.version}} draft: false prerelease: false + deploy: + name: Deploy + runs-on: watchit + needs: publish + steps: + - name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{github.actor}} + password: ${{secrets.GITHUB_TOKEN}} + - name: Stop old WatchIt.WebAPI container + continue-on-error: true + run: docker container stop watchit.webapi + - name: Remove old WatchIt.WebAPI container + continue-on-error: true + run: docker container rm watchit.webapi + - name: Remove old WatchIt.WebAPI image + continue-on-error: true + run: docker image rm ghcr.io/mateuszskoczek/watchit.webapi + - name: Stop old WatchIt.Website container + continue-on-error: true + run: docker container stop watchit.webapi + - name: Remove old WatchIt.Website container + continue-on-error: true + run: docker container rm watchit.webapi + - name: Remove old WatchIt.Website image + continue-on-error: true + run: docker image rm ghcr.io/mateuszskoczek/watchit.website + - name: Pull new WatchIt.WebAPI image + run: docker pull ghcr.io/mateuszskoczek/watchit.webapi:latest + - name: Pull new WatchIt.Website image + run: docker pull ghcr.io/mateuszskoczek/watchit.website:latest