Compare commits
No commits in common. "3f29cd48c0ada53dce2ecc4ce1559b9d7fb2a079" and "89745d3eec3b304fc943b18e54891af60fb472bb" have entirely different histories.
3f29cd48c0
...
89745d3eec
3 changed files with 24 additions and 38 deletions
|
|
@ -1,20 +1,25 @@
|
||||||
name: Build and publish static site
|
name: Publish static bundles
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
branches: [main]
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: site-${{ github.ref }}
|
group: publish-main
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
publish:
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
container:
|
container:
|
||||||
image: node:24-bookworm
|
image: node:24-bookworm
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
env:
|
env:
|
||||||
|
AWS_ACCESS_KEY_ID: ${{ secrets.GARAGE_SITES_ACCESS_KEY_ID }}
|
||||||
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.GARAGE_SITES_SECRET_ACCESS_KEY }}
|
||||||
|
AWS_DEFAULT_REGION: garage-sites
|
||||||
|
GARAGE_S3_ENDPOINT: https://s3-sites.bcgen.ie
|
||||||
NODE_OPTIONS: --max-old-space-size=768
|
NODE_OPTIONS: --max-old-space-size=768
|
||||||
PUBLIC_ANALYTICS_DASHBOARD_URL: ${{ secrets.PUBLIC_ANALYTICS_DASHBOARD_URL }}
|
PUBLIC_ANALYTICS_DASHBOARD_URL: ${{ secrets.PUBLIC_ANALYTICS_DASHBOARD_URL }}
|
||||||
PUBLIC_CONTACT_FORM_ENDPOINT: ${{ secrets.PUBLIC_CONTACT_FORM_ENDPOINT }}
|
PUBLIC_CONTACT_FORM_ENDPOINT: ${{ secrets.PUBLIC_CONTACT_FORM_ENDPOINT }}
|
||||||
|
|
@ -25,16 +30,19 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install validation tools
|
- name: Install build and S3 tools
|
||||||
run: |
|
run: |
|
||||||
|
set -eu
|
||||||
apt-get update -qq
|
apt-get update -qq
|
||||||
apt-get install -y -q python3
|
apt-get install -y -q ca-certificates python3-venv
|
||||||
|
python3 -m venv /opt/awscli
|
||||||
- name: Install dependencies
|
/opt/awscli/bin/pip install --quiet awscli
|
||||||
run: npm ci --no-audit --no-fund
|
|
||||||
|
|
||||||
- name: Build and validate Astro output
|
- name: Build and validate Astro output
|
||||||
run: npm run check
|
run: |
|
||||||
|
set -eu
|
||||||
|
npm ci --no-audit --no-fund
|
||||||
|
npm run check
|
||||||
|
|
||||||
- name: Split public and protected admin bundles
|
- name: Split public and protected admin bundles
|
||||||
run: |
|
run: |
|
||||||
|
|
@ -51,22 +59,7 @@ jobs:
|
||||||
cp -a dist/admin/content bundle-admin/admin/content
|
cp -a dist/admin/content bundle-admin/admin/content
|
||||||
cp dist/css/admin.css bundle-admin/css/admin.css
|
cp dist/css/admin.css bundle-admin/css/admin.css
|
||||||
|
|
||||||
- name: Install Garage publishing tools
|
- name: Publish to Garage
|
||||||
if: github.ref == 'refs/heads/main'
|
|
||||||
run: |
|
|
||||||
set -eu
|
|
||||||
apt-get update -qq
|
|
||||||
apt-get install -y -q ca-certificates python3-venv
|
|
||||||
python3 -m venv /opt/awscli
|
|
||||||
/opt/awscli/bin/pip install --quiet awscli
|
|
||||||
|
|
||||||
- name: Publish main to Garage
|
|
||||||
if: github.ref == 'refs/heads/main'
|
|
||||||
env:
|
|
||||||
AWS_ACCESS_KEY_ID: ${{ secrets.GARAGE_SITES_ACCESS_KEY_ID }}
|
|
||||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.GARAGE_SITES_SECRET_ACCESS_KEY }}
|
|
||||||
AWS_DEFAULT_REGION: garage-sites
|
|
||||||
GARAGE_S3_ENDPOINT: https://s3-sites.bcgen.ie
|
|
||||||
run: |
|
run: |
|
||||||
set -eu
|
set -eu
|
||||||
aws=/opt/awscli/bin/aws
|
aws=/opt/awscli/bin/aws
|
||||||
|
|
|
||||||
|
|
@ -24,8 +24,6 @@ migration continues.
|
||||||
- Keep the structure simple and close to what the user asks for.
|
- Keep the structure simple and close to what the user asks for.
|
||||||
- `.forgejo/` and deployment configuration are not special unless the user says
|
- `.forgejo/` and deployment configuration are not special unless the user says
|
||||||
they are.
|
they are.
|
||||||
- Feature-branch Actions build and validate only. Production Garage publishing
|
|
||||||
is restricted to commits on `main`.
|
|
||||||
|
|
||||||
## Repo Map
|
## Repo Map
|
||||||
|
|
||||||
|
|
|
||||||
17
README.md
17
README.md
|
|
@ -110,18 +110,13 @@ http://localhost:4321/
|
||||||
|
|
||||||
## Deployment
|
## Deployment
|
||||||
|
|
||||||
This project deploys as a static Astro build through Forgejo Actions. Every
|
This project deploys as a static Astro build. A deployment job should install
|
||||||
branch push installs dependencies, builds the complete site, audits its links,
|
dependencies, run the build, and publish the generated `dist/` directory:
|
||||||
and prepares the separate public and protected-admin bundles. Feature branches
|
|
||||||
never receive Garage publishing credentials and never change production.
|
|
||||||
|
|
||||||
Only commits on `main` synchronize the validated bundles to `familyfed.ie` and
|
|
||||||
`admin.familyfed.ie` in Garage. A manual workflow dispatch is subject to the
|
|
||||||
same branch guard: dispatching a feature branch builds it but cannot publish it.
|
|
||||||
|
|
||||||
The equivalent local validation is:
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm ci
|
npm ci
|
||||||
npm run check
|
npm run build
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Use `npm run start` only when you intentionally want Astro to serve the built
|
||||||
|
output in an environment such as a local or Nomad preview job.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue