ci: cancel deploy job if didn't touch repo #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy to DigitalOcean | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
deploy_mana_prod: | |
name: Deploy mana to production | |
environment: mana_prod | |
concurrency: | |
group: mana_prod | |
cancel-in-progress: true | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v3 | |
- name: Check for changes | |
run: git diff-tree --no-commit-id --name-only HEAD -r | grep ^apps/mana || gh run cancel ${{ github.run_id }} | |
- name: Install doctl | |
uses: digitalocean/action-doctl@v2 | |
with: | |
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} | |
- name: Deploy | |
run: doctl apps create-deployment ${{ vars.DIGITALOCEAN_APP_ID }} |