Skip to content

BuildPages

BuildPages #3

Workflow file for this run

name: Build Pages
run-name: BuildPages
on:
push:
branches: ['main']
workflow_dispatch:
concurrency:
group: 'buildPages'
cancel-in-progress: true
permissions:
pull-requests: write
contents: write
pages: write
jobs:
buildPages:
name: Build Pages
environment: github-pages
runs-on: ubuntu-latest
timeout-minutes: 20
permissions:
pull-requests: write
contents: write
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
cache: 'npm'
- name: Setup variables
run: |
touch .env
echo POSTHOG_ANALYTICS_CODE="${{ secrets.POSTHOG_ANALYTICS_CODE }}" >> .env
echo ENABLE_SERVICE_WORKER="${{ secrets.ENABLE_SERVICE_WORKER }}" >> .env
- name: Install packages
run: npm ci --force
- name: Generate Data and Images for each language
run: |
# Allow webpmux to execute
chmod +x ./lib/webpmux
# Start the data script
npm run data
- name: Build Pages
run: npm run build
- name: Generate service worker
run: |
npm run service-worker
- name: Remove gitignore
run: |
rm -f .gitignore
rm -f dist/.gitignore
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: dist