-
Notifications
You must be signed in to change notification settings - Fork 5
/
action.yml
55 lines (48 loc) · 1.45 KB
/
action.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
name: 'Architect Deploy'
description: 'Deploys an Architect app to AWS'
inputs:
aws_access_key_id:
required: true
aws_secret_access_key:
required: true
use_lock_file:
required: false
default: true
node-version:
required: false
default: 14
runs:
using: "composite"
steps:
- name: Cancel previous runs
uses: styfle/[email protected]
- name: Check out repo
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
- name: Install dependencies
uses: bahmutov/npm-install@v1
with:
useLockFile: ${{ inputs.use_lock_file }}
- name: Install Architect
shell: bash
run: npm install @architect/architect
- name: Vendor dist files
shell: bash
run: npm run dist --if-present
- name: Staging Deploy
if: github.ref == 'refs/heads/main'
shell: bash
run: npx arc deploy --staging
env:
AWS_ACCESS_KEY_ID: ${{ inputs.aws_access_key_id }}
AWS_SECRET_ACCESS_KEY: ${{ inputs.aws_secret_access_key }}
- name: Production Deploy
if: startsWith(github.ref, 'refs/tags/v')
shell: bash
run: npx arc deploy --production
env:
AWS_ACCESS_KEY_ID: ${{ inputs.aws_access_key_id }}
AWS_SECRET_ACCESS_KEY: ${{ inputs.aws_secret_access_key }}