Skip to content

GithubPages

GithubPages #28

name: Github Pages
run-name: GithubPages
on:
push:
branches: ['main']
workflow_dispatch:
concurrency:
group: 'githubPages'
cancel-in-progress: true
permissions:
contents: read
pages: write
id-token: write
jobs:
githubPages:
name: Github Pages
environment: github-pages
runs-on: ubuntu-latest
timeout-minutes: 20
permissions:
pull-requests: write
contents: write
strategy:
matrix:
node-version: [21.x]
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
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: Allow webpmux to execute
run: |
chmod +x ./lib/webpmux
chmod +x ./lib/webpmux.exe
- name: Build TS
run: |
npm ci --force
npm run data
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