Merge pull request #9 from grycap/feat-hub-landing #3
This file contains hidden or 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
| name: Build and Publish Pages | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| build-and-commit: | |
| if: github.ref == 'refs/heads/main' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build static site | |
| run: npm run build | |
| - name: Commit updated docs | |
| run: | | |
| if [[ -n "$(git status --short docs CNAME)" ]]; then | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add docs CNAME | |
| git commit -m "chore(docs): update GitHub Pages artifacts" | |
| git push | |
| else | |
| echo "No changes to commit" | |
| fi |