|
1 | 1 | name: Continuous integration |
| 2 | +on: [push, pull_request, workflow_dispatch] |
2 | 3 |
|
3 | | -on: |
4 | | - push: |
5 | | - branches: [ master ] |
6 | | - |
7 | | -# Make sure jobs cannot overlap (e.g. one from push and one from schedule). |
8 | 4 | concurrency: |
9 | | - group: pages-ci |
| 5 | + group: ${{ github.workflow }}|${{ github.ref_name }} |
10 | 6 | cancel-in-progress: true |
11 | 7 |
|
12 | 8 | jobs: |
13 | 9 | build: |
14 | | - name: Build and deploy to GitHub Pages |
| 10 | + name: 🛠️ Build |
15 | 11 | 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 |
16 | 27 |
|
| 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 |
17 | 57 | 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