From b4435c04254ac7b9f63deb01e551f68a43d8144d Mon Sep 17 00:00:00 2001 From: "alex.hill@gmail.com" Date: Thu, 28 Nov 2024 16:02:13 +0000 Subject: [PATCH] also deploy to digitalocean on merge to main --- .../workflows/{docker.yaml => deploy.yaml} | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) rename .github/workflows/{docker.yaml => deploy.yaml} (54%) diff --git a/.github/workflows/docker.yaml b/.github/workflows/deploy.yaml similarity index 54% rename from .github/workflows/docker.yaml rename to .github/workflows/deploy.yaml index cc258b8..e2b2319 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/deploy.yaml @@ -35,3 +35,23 @@ jobs: - name: 🚢 Push image run: ./docker/push + + - id: sha + name: Setup Environment + shell: bash + run: | + if [[ -v "GITHUB_SHA" ]]; then + GIT_SHA=${GITHUB_SHA:0:7} + else + GIT_SHA=$(git rev-parse --short=7 HEAD) + fi + echo "GIT_SHA=${GIT_SHA}" >> $GITHUB_OUTPUT + + - name: Deploy the app + uses: digitalocean/app_action/deploy@v2 + env: + IMAGE_TAG_SEROVIZR: ${{ steps.sha.outputs.GIT_SHA }} + with: + token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} + app_name: seroviz + if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'