-
Notifications
You must be signed in to change notification settings - Fork 15
53 lines (43 loc) · 1.37 KB
/
canary.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
44
45
46
47
48
49
50
51
52
53
name: Build and Commit to Canary
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
environment: canary # Specify the environment
permissions:
contents: write # Grant write permission to the contents scope
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Install frontend dependencies
working-directory: frontend
run: npm ci
- name: Build frontend
working-directory: frontend
run: npm run build
- name: Import GPG key
run: |
echo "${{ secrets.GPG_PRIVATE_KEY }}" | gpg --batch --import
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} # F1E9CF7FAEE383E9
- name: Commit and push to canary branch
run: |
export GPG_TTY=$(tty)
git config --global user.name '${{ vars.GPG_USER_NAME }}'
git config --global user.email '${{ vars.GPG_USER_EMAIL }}'
git config --global commit.gpgSign true
git config --global user.signingkey ${{ vars.GPG_KEY_ID }}
git checkout main
git checkout -B canary
git add -f frontend/dist
git commit -S -m "Update canary with latest build from main"
git push origin canary --force
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}