-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (52 loc) · 1.74 KB
/
rewatch_pipeline.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: rewatch application pipeline
on:
push:
branches:
- master
jobs:
run-build-test:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
name: Build and tests application code and updates archives to s3
steps:
# confirms the value of ${{vars.PROJECT_NAME}} is 'rewatch'
- name: validate-project-name
run: |
if [ ${{vars.PROJECT_NAME}} != 'rewatch' ]; then
echo "Project name is not 'rewatch'"
exit 1
fi
- name: checkout-current-branch
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python 3.11
uses: actions/setup-python@v2
with:
python-version: 3.11
- name: make-scripts-executable
run: |
chmod +x 'scripts/invoke_rewatch_handler.sh'
chmod +x 'scripts/rewatch_build_test.sh'
- name: assume-github-actions-role
uses: aws-actions/configure-aws-credentials@v4
with:
audience: sts.amazonaws.com
aws-region: ${{vars.REGION_NAME}}
role-to-assume: arn:aws:iam::${{secrets.AWS_ACCOUNT_ID}}:role/${{vars.PROJECT_NAME}}-github-actions-role
- name: test-and-build-deployment-archive
shell: bash
env:
AWS_ACCOUNT_ID: ${{secrets.AWS_ACCOUNT_ID}}
PROJECT_NAME: ${{vars.PROJECT_NAME}}
REGION_NAME: ${{vars.REGION_NAME}}
run: 'scripts/rewatch_build_test.sh'
- name: invoke-${{vars.PROJECT_NAME}}-handler
shell: bash
env:
AWS_ACCOUNT_ID: ${{secrets.AWS_ACCOUNT_ID}}
PROJECT_NAME: ${{vars.PROJECT_NAME}}
REGION_NAME: ${{vars.REGION_NAME}}
run: 'scripts/invoke_rewatch_handler.sh'