-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (58 loc) · 1.63 KB
/
main.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
name: Main
on:
workflow_dispatch:
inputs:
branch:
type: choice
description: Target branch name
required: false
default: main
options:
## v1 is a fixed major version
- v1
## main will always be latest (regardless of major version)
- main
## dev is for testing only
- dev
force:
type: boolean
description: Force the deployment
required: false
default: false
push:
branches:
- main
jobs:
main:
runs-on: ubuntu-latest
env:
AC_FORCE: ${{ inputs.force }}
AC_AUTOBUILD: false
AC_OUTPUT: common/temp/actions
AC_COMMIT_REPO: kc-workspace/github-actions
AC_COMMIT_BRANCH: ${{ inputs.branch || 'main' }}
steps:
- name: Set up base repository
uses: actions/checkout@v4
- name: Set up pnpm
uses: pnpm/action-setup@v2
- name: Set up nodejs
uses: actions/setup-node@v4
with:
node-version-file: package.json
cache-dependency-path: pnpm-lock.yaml
cache: pnpm
- name: Install dependencies
run: common/scripts/index.sh install
- name: Lint / Build / Test packages
run: common/scripts/index.sh test
- name: Set up target repository
uses: actions/checkout@v4
with:
repository: ${{ env.AC_COMMIT_REPO }}
ref: ${{ env.AC_COMMIT_BRANCH }}
path: ${{ env.AC_OUTPUT }}
ssh-key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
fetch-depth: 0
- name: Deploy target repository
run: common/scripts/index.sh deploy