-
Notifications
You must be signed in to change notification settings - Fork 1
43 lines (36 loc) · 1.11 KB
/
publish.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: Publish
on:
push:
branches:
- main
pull_request_target:
branches:
- main
jobs:
website:
name: Publish website
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install NodeJS
uses: actions/setup-node@v3
with:
registry-url: https://npm.pkg.github.com
scope: "@openttd"
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install dependencies
run: npm install
- name: Build website
run: |
NEXT_PUBLIC_LOCATION_NILE_DATA=https://nile-data-preview.openttd.org LOCATION_NILE_CONFIG=https://raw.githubusercontent.com/OpenTTD/nile-config/main/ npm run build
- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@v1
id: pages
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: ${{ vars.CLOUDFLARE_PROJECT_NAME }}
directory: dist
branch: ${{ github.event_name == 'push' && github.ref_name || format('pr/{0}', github.event.pull_request.number) }}