Some checks failed
Deploy to S3 / deploy (push) Failing after 1m47s
setup-node provides Node but not Yarn; the workflow was relying on the runner
image shipping it, as GitHub's hosted images do. When the act_runner image
changed, `yarn install` began failing with exit 127 and every push since
6964ce7 (2026-07-19) silently stopped deploying — a dead pipeline reads the
same as a site that did not need to change.
Pinned to 1.x: the lockfile is v1 and `--frozen-lockfile` is v1 syntax.
55 lines
1.9 KiB
YAML
55 lines
1.9 KiB
YAML
name: Deploy to S3
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "22"
|
|
|
|
# setup-node installs Node but not Yarn. GitHub's hosted images happen to
|
|
# ship Yarn preinstalled, so this workflow was silently depending on the
|
|
# image rather than on anything declared here — and broke the moment the
|
|
# act_runner image changed, with `yarn: command not found` (exit 127).
|
|
# Pin to 1.x: the lockfile is v1 format and `--frozen-lockfile` is v1
|
|
# syntax (v2+ renamed it `--immutable`).
|
|
- name: Install Yarn
|
|
run: npm install -g yarn@1
|
|
|
|
- name: Install dependencies
|
|
run: yarn install --frozen-lockfile
|
|
|
|
- name: Build
|
|
run: yarn build
|
|
|
|
- name: Deploy to S3
|
|
env:
|
|
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
|
|
run: |
|
|
apt-get update -qq && apt-get install -y -qq awscli > /dev/null
|
|
aws s3 sync _site/ s3://${{ vars.S3_BUCKET }} --delete
|
|
# sync guesses text/markdown for .md, which Firefox downloads
|
|
# instead of displaying; text/plain shows the raw text in the tab
|
|
aws s3 cp _site/CLAUDE.md s3://${{ vars.S3_BUCKET }}/CLAUDE.md \
|
|
--content-type "text/plain; charset=utf-8"
|
|
|
|
- name: Invalidate CloudFront
|
|
if: vars.CF_DISTRIBUTION_ID != ''
|
|
env:
|
|
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
|
|
run: |
|
|
aws cloudfront create-invalidation \
|
|
--distribution-id ${{ vars.CF_DISTRIBUTION_ID }} \
|
|
--paths "/*"
|