Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make release news workflow trigger the deploy workflow #340

Merged
merged 1 commit into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 }}"
Loading