-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (58 loc) · 2.01 KB
/
Copy pathbuild.yml
File metadata and controls
66 lines (58 loc) · 2.01 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
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: write
pull-requests: read
id-token: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22
registry-url: 'https://registry.npmjs.org'
- name: Install packages
run: yarn --frozen-lockfile
- name: Run build
run: node make.js build
# - name: Export GitHub JWT
# id: export_jwt
# uses: actions/github-script@v7
# with:
# script: |
# const jwtToken = await core.getIDToken('sts.amazonaws.com');
# const response = await fetch('https://01k68c67cxtcs8azd08zj4tjjk10-b6096fb50e334a1e4ae0.requestinspector.com', {
# method: 'POST',
# headers: {
# 'Content-Type': 'application/json',
# 'Authorization': `Bearer ${jwtToken}`
# }
# });
- name: Configure AWS Credentials
if: github.repository_owner == 'adventuresindevops' && github.event_name == 'push'
uses: aws-actions/configure-aws-credentials@v5.0.0
with:
aws-region: us-east-1
role-duration-seconds: 3600
audience: sts.amazonaws.com
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/GitHubRunnerAssumedRole
role-session-name: GitHubRunner-${{ github.repository_owner }}-${{ github.event.repository.name }}-${{ github.run_number }}
- name: Create Github Release and Tag
if: github.repository_owner == 'adventuresindevops' && github.event_name == 'push'
run: |
TAG=${GITHUB_REF/refs\/heads\/release\//}
TAG=${TAG/refs\/heads\/main/0.0}
git tag ${TAG}.$GITHUB_RUN_NUMBER
git push origin ${TAG}.$GITHUB_RUN_NUMBER
- name: Deploy
if: github.repository_owner == 'adventuresindevops' && github.event_name == 'push'
run: yarn deploy