Skip to content

Commit

Permalink
test: test action
Browse files Browse the repository at this point in the history
  • Loading branch information
MDavidson17 committed Nov 20, 2023
1 parent 46c090d commit 47b78a8
Showing 1 changed file with 69 additions and 0 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/test.yml
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

0 comments on commit 47b78a8

Please sign in to comment.