-
Notifications
You must be signed in to change notification settings - Fork 0
123 lines (122 loc) · 3.82 KB
/
pr-check.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
name: tech-squawks-valaidate
on: [pull_request]
jobs:
get-pulumi-projects:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
- uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install python script requirements
run: pip3 install -r scripts/requirements.txt
- id: set-matrix
run: echo "::set-output name=matrix::$(python scripts/ci_helper.py code ls)"
validate-pulumi-preview:
needs: get-pulumi-projects
runs-on: ubuntu-latest
if: ${{ needs.get-pulumi-projects.outputs.matrix != '[]' && needs.get-pulumi-projects.outputs.matrix != '' }}
strategy:
matrix:
project: ${{fromJson(needs.get-pulumi-projects.outputs.matrix)}}
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions/setup-node@v2
with:
node-version: 14.x
- uses: actions/setup-go@v2
with:
go-version: 1.17.x
- uses: actions/setup-python@v2
with:
python-version: 3.9
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-region: ${{ secrets.AWS_REGION }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Install Dependencies
run: bash scripts/install_dep.sh
env:
WORKING_DIR: ${{ matrix.project }}
- uses: pulumi/actions@v4
with:
upsert: true
command: preview
stack-name: dev
work-dir: ./${{ matrix.project }}
comment-on-pr: false
env:
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}
build-website:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions/setup-node@v2
with:
node-version: 14.x
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.111.3'
- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: Render Static Website
run: (cd web; hugo)
pulumi-prod-preview:
runs-on: ubuntu-latest
needs: build-website
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions/setup-node@v2
with:
node-version: 14.x
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.111.3'
- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: Install 'embedme' tool
run: npm i embedme
- name: Embed code examples
run: npx embedme --source-root code web/content/**/*.md --silent
- name: Render Static Website
run: (cd web; hugo)
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-region: ${{ secrets.AWS_REGION }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Install Project Dependencies
run: npm i
- uses: pulumi/actions@v4
with:
command: preview
diff: true
stack-name: production
comment-on-pr: true
env:
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}