Migrate deployment to GitHub Pages

This commit is contained in:
Thaddeus Crews
2025-12-04 10:25:28 -06:00
parent 7ee6a283c7
commit 1aa67cd9f1

View File

@@ -1,53 +1,60 @@
name: Continuous integration
on: [push, pull_request, workflow_dispatch]
on:
push:
branches: [ master ]
# Make sure jobs cannot overlap (e.g. one from push and one from schedule).
concurrency:
group: pages-ci
group: ${{ github.workflow }}|${{ github.ref_name }}
cancel-in-progress: true
jobs:
build:
name: Build and deploy to GitHub Pages
name: 🛠️ Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v5
- name: Install Node.js 16.x
uses: actions/setup-node@v4
with:
node-version: 16.x
cache: 'npm'
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Install dependencies
run: npm ci
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 24
cache: npm
- name: Build the static content using npm
run: npm run build
- name: Install dependencies
run: npm ci
- name: Prepare and copy configuration and data
run: npm run publish-db
env:
GRAPHQL_TOKEN: ${{ secrets.GRAPHQL_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build the static content using npm
run: npm run build
- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: web-static
path: out
- name: Prepare and copy configuration and data
run: npm run publish-db
env:
GRAPHQL_TOKEN: ${{ secrets.GRAPHQL_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Deploy to GitHub Pages 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: out
# Configure the commit author.
git-config-name: 'Godot Organization'
git-config-email: '<>'
# Don't keep the history.
single-commit: true
- name: Upload pages artifact
uses: actions/upload-pages-artifact@v4
with:
path: out/
deploy:
name: 📤 Deploy
runs-on: ubuntu-latest
needs: build
if: github.ref_name == github.event.repository.default_branch
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
contents: read
id-token: write
pages: write
concurrency:
group: ci-deploy
cancel-in-progress: false
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4