Build 11ty site for Dev #596
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow is based on the Node.js CI Workflow | |
# This version will checkout the repository and install Node and the project dependencies. | |
# It will run the USWDS compiler and run the production build command to generate the 11ty | |
# static pages. | |
# It will copy the CNAME file to the docs/ folder if necessary, then it will commit and push | |
# these changes back to the repository. | |
name: Build 11ty site for Dev | |
on: | |
schedule: | |
- cron: '0 0 * * *' | |
workflow_dispatch: | |
jobs: | |
build: | |
if: github.repository == 'LACMTA/mybus-v3-dev' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.head_ref }} | |
- name: Use Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm install | |
- name: Install uswds-uswds | |
run: npm install @uswds/uswds | |
- name: Install uswds-compile | |
run: npm install @uswds/compile | |
- name: Compile USWDS | |
run: npx gulp compile | |
- name: Build Site | |
run: npm run dev:build | |
- name: Check file existence | |
id: check_files | |
uses: andstor/file-existence-action@v1 | |
with: | |
files: "CNAME" | |
- name: If CNAME exists then copy CNAME to docs/ | |
if: steps.check_files.outputs.files_exists == 'true' | |
run: cp CNAME docs/ | |
- name: Commit and push changes | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: '[Auto] clean and build site for prod' |