-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (41 loc) · 1.52 KB
/
deploy-production.yml
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: Production Deploy
on:
push:
branches:
- main
workflow_dispatch:
jobs:
deploy:
environment: production
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
name: Deploy to Cloudflare Pages
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'yarn'
- name: Install Packages
run: yarn install
- name: Set .env
run: |
echo "${{ secrets.PROJECT_ENV }}" > .env.local
echo "NEXT_PUBLIC_GOOGLE_TAG_MANAGER_ID=${{ secrets.NEXT_PUBLIC_GOOGLE_TAG_MANAGER_ID }}" >> .env.local
echo "NEXT_PUBLIC_CHANNEL_TALK_PLUGIN_KEY=${{ vars.NEXT_PUBLIC_CHANNEL_TALK_PLUGIN_KEY }}" >> .env.local
echo "NEXT_PUBLIC_SENTRY_DSN=${{ vars.NEXT_PUBLIC_SENTRY_DSN }}" >> .env.local
echo "NEXT_PUBLIC_AMPLITUDE_API_KEY=${{ vars.NEXT_PUBLIC_AMPLITUDE_API_KEY }}" >> .env.local
echo "NEXT_PUBLIC_APP_ENV=production" > .env
- name: Build
run: yarn build:ci
- name: Move artifacts into dist folder
run: mkdir group && mv out/* group/ && mv group out
- name: Publish
run: yarn run wrangler pages publish "out" --project-name "${{ secrets.CLOUDFLARE_PAGES_PROJECT_NAME }}" --commit-message "${{ github.sha }}"
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}