-
Notifications
You must be signed in to change notification settings - Fork 2
54 lines (43 loc) · 1.42 KB
/
test.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
on: [push]
jobs:
main:
name: Build, Format and Test
runs-on: ubuntu-latest
steps:
- uses: linz/action-typescript@dee99184c4305aea6c380a52db9b2d7abaaa3e78 # pin@v3
- name: Download actionlint
run: docker build --tag actionlint - < .github/workflows/actionlint.dockerfile
- name: Run actionlint to check workflow files
run: docker run --volume="${PWD}:/repo" --workdir=/repo actionlint -color
deploy-prod:
runs-on: ubuntu-latest
concurrency: deploy-prod-${{ github.ref }}
needs: [main]
environment:
name: nonprod
permissions:
id-token: write
contents: read
env:
CLUSTER_NAME: Workflows
steps:
- name: get-changes
id: get-changes
run:
mapfile -d '' modified_infra_files < <(git diff --name-only -z ${{ github.event.before }} ${{ github.event.after }} -- "infra/*")
if [[ "${#modified_infra_files[@]}" -ge 1 ]]; then
echo "infra_change=true" >> "$GITHUB_OUTPUT"
else
echo "infra_change=false" >> "$GITHUB_OUTPUT"
fi
- name: Echo test needs
if: steps.get-changes.outputs.infra_change == 'true'
run: |
echo test-needs-true
- name: Echo test needs
if: steps.get-changes.outputs.infra_change == 'false'
run: |
echo test-needs-false
- name: Echo test
run: |
echo test-only