-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (61 loc) · 2.29 KB
/
cd.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Continuous Deployment
on:
push:
branches: [master]
jobs:
cd:
name: Run CD
runs-on: ubuntu-latest
# Grant GITHUB_TOKEN the permissions required to push changes to target branch
permissions:
contents: 'write'
packages: 'write'
actions: 'read'
environment: actions
steps:
- name: Create GitHub App token
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.SYNTHQL_APP_ID }}
private-key: ${{ secrets.SYNTHQL_APP_PRIVATE_KEY }}
- name: Checkout Git Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ steps.app-token.outputs.token }}
- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn
- name: Set up database
run: |
chmod +x ./setup-db.bash
./setup-db.bash
- name: Cache yarn dependencies
uses: actions/cache@v4
with:
path: |
**/node_modules
.yarn/cache
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: yarn install
- name: Run CI tasks
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: yarn ci
# We use the name and email for the GitHub Actions bot, as provided via this link: https://api.github.com/users/github-actions%5Bbot%5D
- name: Set Git user
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Publish packages to NPM & update repository
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: yarn publish-minor-versions