Skip to content

Commit

Permalink
Merge pull request #2294 from geneontology/issue-2235
Browse files Browse the repository at this point in the history
Trigger website rebuild when gorefs.yaml changes
  • Loading branch information
pkalita-lbl authored Apr 12, 2024
2 parents ae85880 + 89370a1 commit 17926de
Showing 1 changed file with 44 additions and 0 deletions.
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 }}

0 comments on commit 17926de

Please sign in to comment.