-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (64 loc) · 1.85 KB
/
deploy-dev.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
72
73
74
75
name: Deploy Push to Dev
on:
push:
branches: main
permissions:
id-token: write
contents: read
env:
aws_account_id: ${{ vars.AWS_ACCOUNT_ID }}
aws_region: ${{ vars.AWS_REGION }}
aws_role: ${{ vars.AWS_ROLE }}
jobs:
setup:
runs-on: ubuntu-latest
outputs:
sha_short: ${{ steps.set_sha.outputs.GITHUB_SHA_SHORT }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ${{ env.aws_region }}
role-to-assume: arn:aws:iam::${{ env.aws_account_id }}:role/${{ env.aws_role }}
role-session-name: GitHubActions
- id: set_sha
run: echo "GITHUB_SHA_SHORT=$(echo $GITHUB_SHA | cut -c 1-6)" >> $GITHUB_OUTPUT
- name: Setup s3 version bucket
env:
S3_BUCKET_NAME: ${{ github.event.repository.name }}-versions
shell: bash
run: |
bash bin/create-s3-bucket.sh
build:
needs: setup
env:
app_folder: src/
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Terraform checks
uses: ./.github/actions/terraform_check
with:
aws_account_id: ${{ env.aws_account_id }}
aws_region: ${{ env.aws_region }}
aws_role: ${{ env.aws_role }}
- name: Build and upload
uses: ./.github/actions/build
with:
aws_account_id: ${{ env.aws_account_id }}
aws_region: ${{ env.aws_region }}
aws_role: ${{ env.aws_role }}
version_file: ${{ needs.setup.outputs.sha_short }}.zip
dev:
needs:
- setup
- build
uses: ./.github/workflows/deploy.yml
with:
stage: dev
version_file: ${{ needs.setup.outputs.sha_short }}.zip