-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (62 loc) · 1.58 KB
/
deploy-worker.yaml
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
name: Deploy worker
on:
push:
paths:
- .github/workflows/deploy-worker.yaml
- src/functions/**
- src/schemas/**
- src/services/**
- src/utils/**
- src/env.d.ts
- terraform/**
- .nvmrc
- .terraformignore
- drizzle.config.ts
- package.json
- tsconfig.json
concurrency: worker
jobs:
node:
name: Build artifacts
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
- name: Install dependencies
run: npm ci
- name: Build Worker
run: npm run build:worker
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: build
path: build
terraform:
name: Deploy artifacts
runs-on: ubuntu-latest
needs: [node]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: build
path: build
- name: Setup Terraform
uses: hashicorp/setup-terraform@v1
with:
cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }}
- name: Terraform Init
working-directory: terraform
run: terraform init
- name: Terraform Validate
working-directory: terraform
run: terraform validate -no-color
- name: Terraform Apply
working-directory: terraform
run: terraform apply -auto-approve