-
Notifications
You must be signed in to change notification settings - Fork 112
86 lines (70 loc) · 2.37 KB
/
pages-deployment.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Cloudflare Pages
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
NEXT_PUBLIC_INTERCOM_ID: re9q5yti
on: [push]
jobs:
yalc_check:
runs-on: ubuntu-latest
outputs:
can_deploy: ${{ steps.has_yalc.conclusion == 'success' }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Yalc
run: npm i -g yalc
- id: has_yalc
run: |
! yalc check | grep -qe .
deploy:
if: ${{ always() }}
runs-on: ubuntu-latest
needs: [yalc_check]
permissions:
contents: read
deployments: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Misc. Deps
run: sudo apt-get install -y libcairo2-dev libjpeg8-dev libpango1.0-dev libgif-dev build-essential g++
- name: Check Yalc
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev' }}
run: if [ ${{ needs.yalc_check.outputs.can_deploy }} != true ]; then exit 1; else exit 0; fi
- name: Install pnpm
run: corepack enable pnpm
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 20
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
- name: Comparison of locales for missing keys
run: pnpm compare-locales
- name: Build and Export
if: ${{ github.ref == 'refs/heads/main' }}
run: pnpm build && pnpm export
- name: Build and Export with Profiler
if: ${{ github.ref != 'refs/heads/main' }}
run: pnpm build:preview && pnpm export
- name: Generate sitemap
if: ${{ github.ref == 'refs/heads/main' }}
run: |
mkdir -p ./out/sitemaps
pnpm generate:sitemaps
env:
SITEMAP_GRAPH_KEY: ${{ secrets.SITEMAP_GRAPH_KEY }}
- name: Publish
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
wranglerVersion: 'v3.57.1'
command: pages deploy --project-name=ens-app-v3
secrets: |
GITHUB_TOKEN
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Submit sitemap
if: ${{ github.ref == 'refs/heads/main' }}
run: curl https://www.google.com/ping\?sitemap=https://app.ens.domains/sitemap.xml