-
Notifications
You must be signed in to change notification settings - Fork 33
60 lines (55 loc) · 1.64 KB
/
on_push_main.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
name: push to main
on:
push:
branches:
- main
jobs:
build:
uses: ./.github/workflows/reusable_build.yml
test:
needs: [build]
uses: ./.github/workflows/reusable_test.yml
deploy:
needs: [test]
uses: ./.github/workflows/reusable_deploy.yml
with:
environment: prod
secrets: inherit
release:
name: publish release
needs: [deploy]
runs-on: ubuntu-latest
container: node:20
permissions:
contents: write
steps:
- uses: actions/checkout@v6
- uses: actions/cache@v3
with:
path: ./node_modules
key: 18f-bot-${{ runner.os }}-${{ hashFiles('package.json') }}-v1
- uses: actions/cache@v3
id: npmcache
with:
path: ./npm-cache
key: 18f-bot-${{ runner.os }}-npmcache-${{ hashFiles('package.json') }}-v1
- name: get current time
id: time
run: |
echo "::set-output name=time::$(date +%Y-%m-%d_%H-%M-%S)"
echo "::set-output name=human::$(date '+%Y-%m-%d, %H:%M:%S')"
- name: zip bundle
uses: byteever/action-build-zip@e42976f29f487a742e0e65aee89375e23f080ada
id: zip
- name: compute zip hash
id: hash
run: |
echo "::set-output name=sha::$(shasum -a 256 ${{ steps.zip.outputs.zip_path }} | cut -d' ' -f1)"
- uses: softprops/action-gh-release@v1
with:
files: ${{ steps.zip.outputs.zip_path }}
name: ${{ steps.time.outputs.human }}
body: |
Bundle hash (SHA256): ${{ steps.hash.outputs.sha }}
generate_release_notes: true
tag_name: ${{ steps.time.outputs.time }}