Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: CI Pipeline
# Produces production artifact, uploads it as workflow artifact

on:
push:
branches: [source]
paths-ignore:
- '**.md'

pull_request:
branches: [source]
paths-ignore:
- '**.md'

# allows this workflow to be run from another
workflow_call:

# allows running this workflow manually from the Actions tab
workflow_dispatch:

jobs:
build:
name: Build
runs-on: 'ubuntu-22.04'
steps:
- name: 🛫 Checkout
uses: actions/checkout@v4
with:
persist-credentials: false

- name: 🧶 Setup Node
uses: actions/setup-node@v4
with:
node-version-file: 'package.json'
cache: 'npm'

- name: 👩‍🔧 Install dependencies
run: npm clean-install

- name: 📦 Build for production
id: build_step
run: npm run production 2>&1 | tee build-output.log

- name: 📤 Upload Pages artifact
uses: actions/upload-pages-artifact@v3
# only run if on source branch or on a tag
if: ${{ github.ref == 'refs/heads/source' || startsWith( github.ref, 'refs/tags/' )}}
with:
path: dist/

- name: 📝 Generate workflow summary
run: |
echo "### 📦 Webpack Build Summary" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
sed -r "s/\x1B\[[0-9;]*[mK]//g" build-output.log >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
42 changes: 42 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Deploy to GitHub Pages

on:
release:
types: [ 'published' ]

# allows running this workflow manually from the Actions tab
workflow_dispatch:

permissions:
contents: read # required for git checkout
pages: write # to deploy to GitHub Pages
id-token: write # to verify the deployment originates from an appropriate source
actions: write # required to write a job summary

jobs:
ci:
name: 🚀 CI
uses: ./.github/workflows/ci.yaml
permissions:
contents: read
actions: write # required to write a job summary

# Deploys Pages artifact to GitHub Pages.
deploy-pages-artifact:
name: Deploy Pages Artifact to GitHub Pages
needs: ci
# Deploy to github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: 'ubuntu-24.04'
steps:
# Deploy the artifact from the 'ci' job
- name: 🚀 Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

- name: 📝 Generate deployment summary
run: |
echo "### 🚀 Deployment Summary" >> $GITHUB_STEP_SUMMARY
echo "Website deployed to: ${{ steps.deployment.outputs.page_url }}" >> $GITHUB_STEP_SUMMARY
Loading