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

Trigger website rebuild when gorefs.yaml changes #2294

Merged
merged 3 commits into from
Apr 12, 2024
Merged
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
44 changes: 44 additions & 0 deletions .github/workflows/trigger-website-rebuild.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# This workflow triggers a rebuild of the GO website when the gorefs.yaml file is updated.
# This repo has the GO Workflow Bot app installed, and the app's private key is stored as
# a repo secret. The private key is used to generate an access token. The access token is
# provided to the GitHub CLI when triggering the deploy workflow in the
# geneontology.github.io repo. Without the app-generated token, the default GITHUB_TOKEN
# would not have the necessary permissions to trigger workflows in a different repo.

name: Trigger Website Rebuild

on:
push:
branches:
- master
paths:
- metadata/gorefs.yaml
- .github/workflows/trigger-website-rebuild.yaml

jobs:
trigger-website-rebuild:
runs-on: ubuntu-latest
steps:
# In theory, a failed validation would have been caught by the qc workflow before this point.
# But we validate again here just to double-check that we're not triggering a rebuild based
# on invalid data. This is also simpler than tying this workflow to the qc workflow.
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
- run: pip install linkml
- name: Validate gorefs.yaml
run: linkml-validate -s metadata/gorefs.schema.yaml metadata/gorefs.yaml

- name: Create GitHub App token
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.WORKFLOW_BOT_APP_ID }}
private-key: ${{ secrets.WORKFLOW_BOT_PRIVATE_KEY }}

- name: Trigger deploy workflow in geneontology.github.io
run: gh workflow run deploy.yaml --repo geneontology/geneontology.github.io
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
Loading