Skip to content

Commit 0b8cc15

Browse files
authored
Merge pull request #32 from Repiteo/github-pages-deployment
Migrate deployment to GitHub Pages
2 parents a6ba9b5 + 1aa67cd commit 0b8cc15

File tree

1 file changed

+50
-43
lines changed

1 file changed

+50
-43
lines changed

.github/workflows/ci.yml

Lines changed: 50 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,60 @@
11
name: Continuous integration
2+
on: [push, pull_request, workflow_dispatch]
23

3-
on:
4-
push:
5-
branches: [ master ]
6-
7-
# Make sure jobs cannot overlap (e.g. one from push and one from schedule).
84
concurrency:
9-
group: pages-ci
5+
group: ${{ github.workflow }}|${{ github.ref_name }}
106
cancel-in-progress: true
117

128
jobs:
139
build:
14-
name: Build and deploy to GitHub Pages
10+
name: 🛠️ Build
1511
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v5
15+
16+
- name: Setup Pages
17+
uses: actions/configure-pages@v5
18+
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v6
21+
with:
22+
node-version: 24
23+
cache: npm
24+
25+
- name: Install dependencies
26+
run: npm ci
1627

28+
- name: Build the static content using npm
29+
run: npm run build
30+
31+
- name: Prepare and copy configuration and data
32+
run: npm run publish-db
33+
env:
34+
GRAPHQL_TOKEN: ${{ secrets.GRAPHQL_TOKEN }}
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
37+
- name: Upload pages artifact
38+
uses: actions/upload-pages-artifact@v4
39+
with:
40+
path: out/
41+
42+
deploy:
43+
name: 📤 Deploy
44+
runs-on: ubuntu-latest
45+
needs: build
46+
if: github.ref_name == github.event.repository.default_branch
47+
environment:
48+
name: github-pages
49+
url: ${{ steps.deployment.outputs.page_url }}
50+
permissions:
51+
contents: read
52+
id-token: write
53+
pages: write
54+
concurrency:
55+
group: ci-deploy
56+
cancel-in-progress: false
1757
steps:
18-
- uses: actions/checkout@v4
19-
20-
- name: Install Node.js 16.x
21-
uses: actions/setup-node@v4
22-
with:
23-
node-version: 16.x
24-
cache: 'npm'
25-
26-
- name: Install dependencies
27-
run: npm ci
28-
29-
- name: Build the static content using npm
30-
run: npm run build
31-
32-
- name: Prepare and copy configuration and data
33-
run: npm run publish-db
34-
env:
35-
GRAPHQL_TOKEN: ${{ secrets.GRAPHQL_TOKEN }}
36-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37-
38-
- name: Archive production artifacts
39-
uses: actions/upload-artifact@v4
40-
with:
41-
name: web-static
42-
path: out
43-
44-
- name: Deploy to GitHub Pages 🚀
45-
uses: JamesIves/github-pages-deploy-action@v4
46-
with:
47-
branch: gh-pages
48-
folder: out
49-
# Configure the commit author.
50-
git-config-name: 'Godot Organization'
51-
git-config-email: '<>'
52-
# Don't keep the history.
53-
single-commit: true
58+
- name: Deploy to GitHub Pages
59+
id: deployment
60+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)