diff --git a/.github/workflows/deploy_branch_github_pages.yml.skip b/.github/workflows/deploy_branch_github_pages.yml.skip
deleted file mode 100644
index 6ffa8447..00000000
--- a/.github/workflows/deploy_branch_github_pages.yml.skip
+++ /dev/null
@@ -1,106 +0,0 @@
-name: GitHub page for branch
-
-on:
- pull_request:
- branches:
- - main
- workflow_dispatch:
-
-permissions:
- contents: read
- pages: write
- id-token: write
-
-concurrency:
- group: "pages"
- cancel-in-progress: false
-
-jobs:
- generate_docs:
- runs-on: ubuntu-latest
- steps:
- - name: Checkout code
- uses: actions/checkout@v4
-
- - name: Set up Ruby
- uses: ruby/setup-ruby@v1
-
- - name: Install Cue
- uses: cue-lang/setup-cue@v1.0.0
- with:
- version: 'v0.7.0'
-
- - name: Install bundler and gems
- run: |
- gem install bundler
- bundle install --jobs 4 --retry 3
-
- - name: Generate dist & docs
- run: make
-
- - name: Upload data
- uses: actions/upload-artifact@v4
- with:
- name: data
- path: docs/_data
-
- build:
- runs-on: ubuntu-latest
- needs: generate_docs
- steps:
- - name: Checkout
- uses: actions/checkout@v4
-
- - name: Download data
- uses: actions/download-artifact@v4
- with:
- name: data
- path: docs/_data
-
- - name: Copy site to PR directory
- run: |
- rm -rf docs/pr/${{ github.event.pull_request.number }}
- mkdir -p docs/pr/${{ github.event.pull_request.number }}
- rsync -av --progress --exclude pr docs/ docs/pr/${{ github.event.pull_request.number }}
-
- - name: Setup Pages
- uses: actions/configure-pages@v4
-
- - name: Build with Jekyll
- uses: actions/jekyll-build-pages@v1
- with:
- source: ./docs
- destination: ./_site
-
- - name: Upload artifact
- uses: actions/upload-pages-artifact@v3
-
- # Doesn't work with current branch protection
- deploy:
- environment:
- name: github-pages
- url: ${{ steps.deployment.outputs.page_url }}
- runs-on: ubuntu-latest
- needs: build
- steps:
- - name: Deploy to GitHub Pages
- id: deployment
- uses: actions/deploy-pages@v4
-
- cleanup:
- if: github.event_name == 'pull_request' && github.event.action == 'closed'
- runs-on: ubuntu-latest
- steps:
- - name: Checkout
- uses: actions/checkout@v2
- with:
- ref: 'gh-pages'
-
- - name: Remove PR site
- run: |
- rm -rf ./pr/${{ github.event.pull_request.number }}
- git config user.name github-actions
- git config user.email github-actions@github.com
- git add .
- git commit -m "Remove site for PR #${{ github.event.pull_request.number }}"
- git push
diff --git a/.github/workflows/deploy_dist.yml b/.github/workflows/deploy_dist.yml
deleted file mode 100644
index 6e3af873..00000000
--- a/.github/workflows/deploy_dist.yml
+++ /dev/null
@@ -1,45 +0,0 @@
-name: Deploy distribution files
-
-on:
- push:
- branches:
- - main
- workflow_dispatch:
-
-concurrency:
- group: "dist"
- cancel-in-progress: false
-
-permissions:
- contents: write
-
-jobs:
- generate_dist:
- runs-on: ubuntu-latest
- steps:
- - name: Checkout code
- uses: actions/checkout@v4
-
- - name: Set up Ruby
- uses: ruby/setup-ruby@v1
-
- - name: Install Cue
- uses: cue-lang/setup-cue@v1.0.0
- with:
- version: 'v0.7.0'
-
- - name: Install bundler and gems
- run: |
- gem install bundler
- bundle install --jobs 4 --retry 3
-
- - name: Generate dist & docs
- run: make
-
- - name: Deploy to releases branch
- uses: s0/git-publish-subdir-action@develop
- env:
- REPO: self
- BRANCH: releases
- FOLDER: dist
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/ensure_dist_committed.yml b/.github/workflows/ensure_dist_committed.yml
new file mode 100644
index 00000000..1236027b
--- /dev/null
+++ b/.github/workflows/ensure_dist_committed.yml
@@ -0,0 +1,51 @@
+name: Ensure distribution files committed are up-to-date
+
+on:
+ pull_request:
+ branches:
+ - main
+ workflow_dispatch:
+
+jobs:
+ ensure_dist_committed:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
+
+ - name: Set up Ruby
+ uses: ruby/setup-ruby@v1
+
+ - name: Install Cue
+ uses: cue-lang/setup-cue@v1.0.0
+ with:
+ version: 'v0.7.0'
+
+ - name: Install bundler and gems
+ run: |
+ gem install bundler
+ bundle install --jobs 4 --retry 3
+
+ - name: Generate distribution files
+ run: make
+
+ - name: Ensure there are no uncommitted distrubtion file changes
+ id: ensure-dist-committed
+ run: |
+ git diff --exit-code || (echo "Please commit the changes made by the build process" && exit 1)
+
+ - name: Inform PR author of failure and path to fix
+ if: ${{ failure() && steps.ensure-dist-committed.outcome == 'failure' }}
+ run: |
+ # Comment to send
+ COMMENT="Hi there! It looks like your pull request changes taxonomy \`data/*\` files, but is missing updates to \`dist/*\` files.
**⏭️ How to fix**
Make a PR comment of \`/generate_dist\`, and I will fix this for you :robot:. Alternatively, you can run \`make\` locally and commit the changes yourself."
+
+ # GitHub API Token and PR URL
+ GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
+ COMMENT_URL="https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments"
+
+ # Use jq to encode the JSON properly, carefully handling the new lines and backticks
+ JSON_BODY=$(jq -n --arg body "$COMMENT" '{body: $body}')
+
+ # Use curl to post the comment.
+ curl -s -H "Authorization: token ${GITHUB_TOKEN}" -X POST "$COMMENT_URL" -d "$JSON_BODY"
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 937446d2..bdd474eb 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -7,6 +7,7 @@ on:
pull_request:
branches:
- main
+ workflow_dispatch:
jobs:
test: