-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (64 loc) · 2.15 KB
/
workflow.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Workflow
permissions:
id-token: write
contents: read
on:
push:
branches:
- main
workflow_dispatch:
jobs:
apply-changes:
name: Apply ${{ matrix.stack }}
runs-on: ubuntu-latest
concurrency: pulumi
strategy:
fail-fast: false
matrix:
include:
- stack: prod
refresh: false
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Detecting changes in ${{ matrix.stack }}
uses: dorny/paths-filter@v2
id: changes
with:
filters: |
src:
- 'stacks/${{ matrix.path }}/**'
- 'yarn.lock'
- 'package.json'
- '.github/workflows/*'
- 'Pulumi.${{ matrix.stack }}.yaml'
- name: Authenticate with GCP
if: github.event_name == 'workflow_dispatch' || steps.changes.outputs.src == 'true'
uses: google-github-actions/auth@v0
with:
workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }}
service_account: [email protected]
- name: Authenticate with GKE
if: github.event_name == 'workflow_dispatch' || steps.changes.outputs.src == 'true'
uses: 'google-github-actions/get-gke-credentials@v0'
with:
cluster_name: ${{ secrets.CLUSTER_NAME }}
location: ${{ secrets.CLUSTER_LOCATION }}
- name: Use Node LTS
if: github.event_name == 'workflow_dispatch' || steps.changes.outputs.src == 'true'
uses: actions/setup-node@v3
with:
node-version: lts/*
cache: yarn
- name: Install dependencies
if: github.event_name == 'workflow_dispatch' || steps.changes.outputs.src == 'true'
run: yarn install
- name: Lint
if: github.event_name == 'workflow_dispatch' || steps.changes.outputs.src == 'true'
run: yarn lint
- uses: pulumi/actions@v3
if: github.event_name == 'workflow_dispatch' || steps.changes.outputs.src == 'true'
with:
command: up
refresh: ${{ matrix.refresh }}
stack-name: ${{ matrix.stack }}