Skip to content

Commit

Permalink
ci: Limit publish trigger only when build succeeds and build on main …
Browse files Browse the repository at this point in the history
…branch
  • Loading branch information
ketozhang committed Aug 4, 2024
1 parent 1f0fee5 commit c6c648d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
workflows: ["Build pages"]
types:
- completed
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -16,13 +17,14 @@ permissions:
pages: write
id-token: write

# Allow one concurrent deployment
# Allow only latest publish pages to run
concurrency:
group: "pages"
cancel-in-progress: true

jobs:
deploy:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
Expand Down

0 comments on commit c6c648d

Please sign in to comment.