-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (46 loc) · 1.2 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
name: deploy
on: push
permissions:
contents: read
id-token: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
cache: npm
node-version: 16
- run: npm install
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: artifact
path: node_modules/
deploy-infra:
needs: build
if: github.ref_name == 'hello-world'
steps:
- uses: actions/checkout@v3
- uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ secrets.IAMROLE_GITHUB }}
role-session-name: GitHub-Action-Role
aws-region: eu-west-1
- run: |
aws cloudformation deploy \
--region eu-west-1 \
--stack-name website \
--template-file main.yml \
--no-fail-on-empty-changeset \
--capabilities CAPABILITY_NAMED_IAM \
--parameter-overrides \
EC2InstanceType=t2.micro
deploy:
needs: deploy-infra
if: github.ref_name == 'hello-world'
steps:
- uses: actions/checkout@v3
- run: |
echo 'hello world'