-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (45 loc) · 1.33 KB
/
deploy.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
name: "Deploy"
on:
workflow_dispatch:
push:
branches:
- master
jobs:
deploy:
strategy:
matrix:
os: [ubuntu-22.04]
runs-on: ${{ matrix.os }}
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v4
- name: Load .env File
run: |
set -a
[ -f .env ] && source .env
echo "AWS_REGION=$REGION" >> $GITHUB_ENV
echo "AWS_ACCOUNT=$AWS_ACCOUNT" >> $GITHUB_ENV
echo "GITHUB_CI_ROLE=$GITHUB_CI_ROLE" >> $GITHUB_ENV
echo "ASSET_BUCKET=$ASSET_BUCKET" >> $GITHUB_ENV
set +a
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::${{ env.AWS_ACCOUNT }}:role/${{ env.GITHUB_CI_ROLE }}
aws-region: ${{ env.AWS_REGION }}
- name: Copy images to S3
run: |
aws s3 cp ./src/static/images/ s3://${{ env.ASSET_BUCKET }}/ --recursive --acl public-read
- name: Use Node.js v18.20.5
uses: actions/setup-node@v3
with:
node-version: 18.20.5
- run: npm ci
- name: install serverless
run: npm i -g serverless@3
- name: install poetry
run: pip install poetry
- name: serverless deploy
run: sls deploy --verbose