chore(deps-dev): bump aws-sdk-mock from 6.0.4 to 6.2.1 #5224
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
name: Build, Test and Deploy Gatsby | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
schedule: | |
# Scheduled build so pipeline failures are noticed quicker. | |
- cron: "30 4 * * 3,6" | |
repository_dispatch: | |
types: | |
- content-update | |
jobs: | |
# Fetch dependencies and build Gatsby | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
if: github.ref != 'refs/heads/gh-pages' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@main | |
with: | |
fetch-depth: 1 | |
- name: Restore Cached Build | |
uses: actions/cache@v4 | |
id: cache-public | |
with: | |
path: services/personal-website/public | |
key: build | |
- uses: pnpm/action-setup@v4 | |
name: Install pnpm | |
with: | |
version: 8 | |
run_install: false | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: ".nvmrc" | |
cache: "pnpm" | |
- name: Restore node_modules | |
uses: actions/cache@v4 | |
id: cache-node_modules | |
with: | |
key: node_modules-${{ hashFiles('**/package-lock.json') }} | |
path: | | |
node_modules | |
*/*/node_modules | |
- name: Install Dependencies | |
run: | | |
pnpm install --ignore-scripts --filter @alexwilson/personal-website... | |
- name: Build | |
run: pnpx lerna run --scope @alexwilson/personal-website build | |
env: | |
GITHUB_TOKEN: ${{ secrets.CONTENT_ACCESS_TOKEN }} | |
CI: true | |
- name: Save Build Artefact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: site-artefact | |
path: services/personal-website/public | |
# Run unit tests on the artefact we just built. | |
test: | |
name: Test | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@main | |
with: | |
fetch-depth: 1 | |
- uses: pnpm/action-setup@v4 | |
name: Install pnpm | |
with: | |
version: 8 | |
run_install: false | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: ".nvmrc" | |
cache: "pnpm" | |
- name: Restore node_modules | |
uses: actions/cache@v4 | |
id: cache-node_modules | |
with: | |
key: node_modules-${{ hashFiles('**/package-lock.json') }} | |
path: | | |
node_modules | |
*/*/node_modules | |
- name: Install Dependencies | |
run: | | |
pnpm install --ignore-scripts --filter @alexwilson/personal-website... | |
- name: Run Tests | |
run: pnpx lerna run --scope @alexwilson/personal-website test | |
validate-feed: | |
name: "Validate feed" | |
needs: build | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@main | |
with: | |
repository: w3c/feedvalidator | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.7" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Download Website Artefact | |
uses: actions/download-artifact@v4 | |
with: | |
name: site-artefact | |
path: public | |
- name: "Update feed location for local testing" | |
run: | | |
# Replace references to feed IRI with feedvalidator.org which W3C validator uses as a mock origin. | |
sed -i 's|https://alexwilson.tech/feed.xml|http://www.feedvalidator.org/public/feed.xml|g' public/feed.xml | |
- name: "Validate Artefacted Feed" | |
run: | | |
python src/demo.py public/feed.xml | |
# Deploy to Github Pages environment | |
deploy-ghpages: | |
name: Deploy Gatsby to Github Pages | |
needs: [test, validate-feed] | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@main | |
with: | |
fetch-depth: 1 | |
- name: Download Website Artefact | |
uses: actions/download-artifact@v4 | |
with: | |
name: site-artefact | |
path: public | |
- name: Deploy to Github Pages | |
uses: ./.github/actions/github-pages/ | |
env: | |
GITHUB_TOKEN: ${{ secrets.PAGES_GH_TOKEN }} | |
with: | |
args: public |