-
Notifications
You must be signed in to change notification settings - Fork 28
95 lines (83 loc) · 3 KB
/
Copy pathmain.yml
File metadata and controls
95 lines (83 loc) · 3 KB
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Main
on:
push:
paths-ignore:
- "**/*.md"
pull_request:
issues:
issue_comment:
workflow_dispatch:
jobs:
issue:
uses: codeforlife-education/codeforlife-workspace/.github/workflows/issues.yaml@main
secrets: inherit
contributor:
uses: codeforlife-education/codeforlife-contributor-backend/.github/workflows/check-pr-authors-signed-latest-agreement.yaml@main
permissions:
id-token: write
test:
uses: codeforlife-education/codeforlife-workspace/.github/workflows/test-javascript-code.yaml@main
secrets: inherit
with:
node-version: 22
build:
needs: [test]
runs-on: ubuntu-latest
outputs:
sha: ${{ steps.push-dist-files.outputs.sha }}
steps:
- name: 🤖 Set up CFL bot
uses: codeforlife-education/codeforlife-workspace/.github/actions/bot/setup@main
id: setup-bot
with:
cfl-app-private-key: ${{ secrets.CFL_APP_PRIVATE_KEY }}
- name: 🌐 Set up JavaScript 22 Environment
uses: codeforlife-education/codeforlife-workspace/.github/actions/javascript/setup-environment@main
with:
node-version: 22
install-prod: false
gh-token: ${{ steps.setup-bot.outputs.token }}
- name: 🏗️ Build Dist Files
run: yarn run vite build
- name: 📤 Push Dist Files
id: push-dist-files
uses: codeforlife-education/codeforlife-workspace/.github/actions/git/add-commit-push@main
with:
cfl-bot-gh-token: ${{ steps.setup-bot.outputs.token }}
add: dist
commit-message: "built distribution files"
release:
needs: [build] # TODO: add contributor
concurrency: release
runs-on: ubuntu-latest
permissions:
id-token: write # to enable use of OIDC for npm provenance
# Release if:
# - the repo's owner is Code for Life Education.
# - a change is made to the default branch.
if: |
github.repository_owner_id == vars.CFL_EDU_ORG_ID &&
github.ref_name == github.event.repository.default_branch
steps:
- name: 🤖 Set up CFL bot
uses: codeforlife-education/codeforlife-workspace/.github/actions/bot/setup@main
id: setup-bot
with:
cfl-app-private-key: ${{ secrets.CFL_APP_PRIVATE_KEY }}
- name: 🚀 Publish Semantic Release
uses: codeforlife-education/codeforlife-workspace/.github/actions/github/release@main
with:
ref: ${{ needs.build.outputs.sha }}
cfl-bot-gh-token: ${{ steps.setup-bot.outputs.token }}
cfl-bot-user-name: ${{ steps.setup-bot.outputs.user-name }}
cfl-bot-user-email: ${{ steps.setup-bot.outputs.user-email }}
monitor:
uses: codeforlife-education/codeforlife-workspace/.github/workflows/monitor-javascript-release.yaml@main
secrets: inherit
needs: [release]
with:
node-version: 22
submodule:
uses: codeforlife-education/codeforlife-workspace/.github/workflows/gitmodules.yaml@main
secrets: inherit
needs: [release]