Skip to content

Merge pull request #7268 from StoDevX/drew/remove-feature-flag-implem… #1381

Merge pull request #7268 from StoDevX/drew/remove-feature-flag-implem…

Merge pull request #7268 from StoDevX/drew/remove-feature-flag-implem… #1381

Workflow file for this run

name: Validate/Deploy Data
on:
push: { branches: [master] }
jobs:
validate-then-deploy:
name: Validate, then deploy data
runs-on: ubuntu-latest
steps:
- name: Check out the code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4
with: {node-version-file: '.node-version'}
- name: Install dependencies
run: npm ci
- name: Validate the data
run: |
npm run validate-bus-data
npm run validate-data
# Having validated the data, we now prepare a bundle. This script creates
# files in a docs/ directory.
- name: Bundle the data
run: npm run bundle-data
# Notes: actions/checkout@v2 no longer fetches entire history nor enters
# detached HEAD state. We really just need to check out an (orphaned)
# branch and then add, commit, and push the appropriate directory.
- name: Commit the data
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git checkout --orphan "gh-pages-$GITHUB_SHA"
git --work-tree=docs add .
git commit -m "Automated data deployment at $(date -Is)"
git show --stat HEAD
# If the previous commit successfully happened, download the latest state
# of the remote branch gh-pages.
- name: Deploy the data
run: |
git fetch --prune --unshallow origin gh-pages
git push --force-with-lease origin "gh-pages-$GITHUB_SHA:gh-pages"