Skip to content

Commit

Permalink
Make release news workflow trigger the deploy workflow (#340)
Browse files Browse the repository at this point in the history
  • Loading branch information
popematt committed Sep 10, 2024
1 parent 5970965 commit d1b07be
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ permissions:
pages: write

on:
# Allow manual starting of this workflow, including using `gh workflow run` in the release news workflow
workflow_dispatch:
push:
branches: [ gh-pages ]

Expand Down
16 changes: 11 additions & 5 deletions .github/workflows/release-news.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
# This is needed so that the deploy workflow will be triggered for news release commits.
# See https://github.com/orgs/community/discussions/26220
persist-credentials: false

- name: Generate News Posts
id: generate_news
shell: bash
Expand All @@ -38,3 +33,14 @@ jobs:
git config user.email [email protected]
git commit -m "${{ steps.generate_news.outputs.generated_commit_message }}"
git push
- name: Deploy Changes
if: ${{ steps.generate_news.outputs.changes > 0 }}
# If you use the GITHUB_TOKEN to push code, it won't trigger any on-push
# workflows, so we manually the workflow here.
# We can't just call the workflow directly because we need the workflow to run
# on the new commit, not the GITHUB_REF for this workflow.
env:
GH_TOKEN: ${{ github.token }}
run: |
gh workflow run .github/workflows/deploy.yml -R "${{ github.repository }}"

0 comments on commit d1b07be

Please sign in to comment.