-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (43 loc) · 1.5 KB
/
deploy.yml
File metadata and controls
55 lines (43 loc) · 1.5 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
name: deploy
on:
workflow_run:
workflows: ["build"]
branches: [main]
types:
- completed
jobs:
deploy:
if: ${{ github.ref == 'refs/heads/main' && github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.18
- name: Install AWS CLI
run: |
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install --update
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-north-1
- name: Update cloudformation API spec
run: aws s3 cp api/openapi.yaml s3://cards-keyforge/openapi/openapi-${{ github.sha }}.yaml
- name: Build
run: make build_all
- name: Zip binaries
run: make zip_functions
- name: Upload functions to S3
run: aws s3 cp build/ s3://cards-keyforge/functions/ --recursive --exclude "*" --include "*.zip"
- name: Deploy to AWS CloudFormation
uses: aws-actions/aws-cloudformation-github-deploy@v1
with:
name: cardsofkeyforge-backend
template: cloudformation.yml
capabilities: "CAPABILITY_AUTO_EXPAND,CAPABILITY_IAM"
parameter-overrides: GithubHash=${{ github.sha }}