-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
46c090d
commit 47b78a8
Showing
1 changed file
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
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 | ||
|
||
get-infra-changes: | ||
name: Check for Edits in ./infra/ | ||
outputs: | ||
run_infra: ${{ steps.check_infra.outputs.infra_change}} | ||
runs-on: ubuntu-latest | ||
|
||
environment: | ||
name: nonprod | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: get changes | ||
id: check_infra | ||
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 "::set-output bame=infra_change::true" | ||
else | ||
echo "::set-output bame=infra_change::false" | ||
fi | ||
deploy-prod: | ||
runs-on: ubuntu-latest | ||
concurrency: deploy-prod-${{ github.ref }} | ||
needs: [main, get-infra-changes] | ||
|
||
environment: | ||
name: nonprod | ||
|
||
permissions: | ||
id-token: write | ||
contents: read | ||
|
||
env: | ||
CLUSTER_NAME: Workflows | ||
|
||
steps: | ||
- name: Echo test needs | ||
if: needs.get-infra-changes.outputs.run_infra == 'true' | ||
run: | | ||
echo test-needs-true | ||
- name: Echo test needs | ||
if: needs.get-infra-changes.outputs.run_infra == 'false' | ||
run: | | ||
echo test-needs-false | ||
- name: Echo test | ||
run: | | ||
echo test-only |