This repository has been archived by the owner on Oct 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (58 loc) · 1.92 KB
/
release.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
61
62
63
64
65
66
67
68
69
70
71
name: Release
on:
pull_request:
branches:
- main
types:
- closed
env:
SESSION_NAME: "gh_action"
AWS_REGION: "us-east-2"
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
Deploy:
if: github.event.pull_request.merged == true && startsWith(github.head_ref, 'release/')
runs-on: ubuntu-latest
environment: Production
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '20'
distribution: 'zulu'
- name: Install xmlstarlet
run: sudo apt-get update && sudo apt-get install -y xmlstarlet
- name: SetVars
run: |
sed -i 's/${AWS::AccountId}/${{ secrets.AWS_ACCOUNT_ID }}/' infra/role/template.yml
- name: AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::254962200554:role/GitHubDeployBase
role-session-name: ${{ env.SESSION_NAME }}
aws-region: ${{ env.AWS_REGION }}
- name: SAM Deploy GitHub
run: cd infra/role && sam build && sam package && sam deploy
- name: AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::254962200554:role/GitHubDeployPublishDataLoad
role-session-name: ${{ env.SESSION_NAME }}
aws-region: ${{ env.AWS_REGION }}
- name: SAM Deploy AWS
run: cd infra/function && sam build && sam package && sam deploy
- name: Get Version
id: version
run: echo "current=$(xmlstarlet sel -t -m _:project -v _:version pom.xml)" >> $GITHUB_OUTPUT
- name: Create Release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.version.outputs.current }}