-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (61 loc) · 1.79 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
63
64
65
66
67
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
push:
branches:
- main
env:
ACTIONS_COMMIT_NAME: github-actions[bot]
ACTIONS_COMMIT_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com
ACTIONS_COMMIT_MSG: "perf(core): automatically updates (bot)"
jobs:
main:
runs-on: ubuntu-latest
env:
ACTIONS_TARGET_BRANCH: ${{ inputs.branch || 'main' }}
ACTIONS_TARGET_DIRECTORY: .cache
steps:
- name: Set up base repository
uses: actions/checkout@v4
- name: Set up pnpm
uses: pnpm/action-setup@v2
with:
package_json_file: actions/package.json
- name: Set up nodejs
uses: actions/setup-node@v4
with:
node-version-file: actions/package.json
cache-dependency-path: actions/pnpm-lock.yaml
cache: pnpm
- name: Install actions dependencies
working-directory: actions
run: pnpm install
- name: Lint actions
working-directory: actions
run: pnpm lint
- name: Test actions
working-directory: actions
run: pnpm test
- name: Set up target repository
uses: actions/checkout@v4
with:
repository: cognius/github-actions
ref: ${{ env.ACTIONS_TARGET_BRANCH }}
path: ${{ env.ACTIONS_TARGET_DIRECTORY }}
ssh-key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
fetch-depth: 0
- name: Deploy target repository
run: scripts/deploy.sh