diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index a1419ab..b8ece9f 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -42,10 +42,22 @@ jobs: - name: 🚢 Push image run: ./scripts/push - - name: Install doctl - uses: digitalocean/action-doctl@v2 + - id: sha + name: Setup Environment + shell: bash + run: | + if [ "${{github.event_name}}" = "pull_request" ]; + then + long_sha=${{ github.event.pull_request.head.sha }} + else + long_sha=${GITHUB_SHA} + fi + echo "GIT_SHA=${long_sha:0:7}" >> $GITHUB_OUTPUT + + - name: Deploy the app + uses: digitalocean/app_actions/deploy@v2 + env: + IMAGE_TAG_SEROVIZ: ${{ steps.sha.outputs.GIT_SHA }} with: token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} - - - name: Deploy - run: doctl apps create-deployment ${{ secrets.DIGITALOCEAN_APP_ID }} --force-rebuild=true + app_name: seroviz