-
Notifications
You must be signed in to change notification settings - Fork 4
69 lines (58 loc) · 2.01 KB
/
daily-build.yml
File metadata and controls
69 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
67
68
69
name: Build NRL Project on Environment
run-name: Build NRL Project on ${{ inputs.environment || 'dev' }}
permissions:
id-token: write
contents: read
actions: write
on:
schedule:
- cron: "0 1 * * *"
workflow_dispatch:
inputs:
environment:
type: environment
description: "The environment to deploy changes to"
default: "dev"
required: true
jobs:
build:
name: Build - ${{ github.ref }}
runs-on: codebuild-nhsd-nrlf-ci-build-project-${{ github.run_id }}-${{ github.run_attempt }}
steps:
- name: Git clone - ${{ github.ref }}
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Setup environment
run: |
echo "${HOME}/.asdf/bin" >> $GITHUB_PATH
poetry install --no-root
- name: Run Linting
run: make lint
- name: Run Unit Tests
run: make test
- name: Build Project
run: make build
- name: Configure Management Credentials
uses: aws-actions/configure-aws-credentials@a03048d87541d1d9fcf2ecf528a4a65ba9bd7838 #v5.0.0
with:
aws-region: eu-west-2
role-to-assume: ${{ secrets.MGMT_ROLE_ARN }}
role-session-name: github-actions-ci-${{ inputs.environment || 'dev' }}-${{ github.run_id }}
- name: Add S3 Permissions to Lambda
run: |
account=$(echo '${{ inputs.environment || 'dev' }}' | cut -d '-' -f1)
inactive_stack=$(poetry run python ./scripts/get_env_config.py inactive-stack ${{ inputs.environment || 'dev' }})
make get-s3-perms ENV=${account} TF_WORKSPACE_NAME=${inactive_stack}
- name: Save Build Artifacts
uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: |
dist/*.zip
!dist/nrlf_permissions.zip
- name: Save NRLF Permissions cache
uses: actions/cache/save@v4
with:
key: ${{ github.run_id }}-nrlf-permissions
path: dist/nrlf_permissions.zip