Skip to content

Commit

Permalink
deploy with label
Browse files Browse the repository at this point in the history
  • Loading branch information
crlssn committed Nov 18, 2024
1 parent 34113b2 commit 1e3fbd5
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ on:
push:
branches:
- main
pull_request:
types:
- labeled

jobs:
deploy:
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.label.name == 'deploy')
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -64,3 +68,13 @@ jobs:
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws_region: ${{ vars.AWS_REGION }}
aws_bucket_name: ${{ vars.AWS_BUCKET_NAME }}

- name: Remove deploy label
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
curl -X DELETE \
-H "Authorization: Bearer $GITHUB_TOKEN" \
-H "Accept: application/vnd.github+json" \
https://api.github.com/repos/${{ github.repository }}/issues/${PR_NUMBER}/labels/deploy

0 comments on commit 1e3fbd5

Please sign in to comment.