diff --git a/.github/actions/package-terraform/action.yml b/.github/actions/package-terraform/action.yml new file mode 100644 index 0000000..f445ccf --- /dev/null +++ b/.github/actions/package-terraform/action.yml @@ -0,0 +1,21 @@ +name: "Package Terraform" +description: "Validate and package terraform configuration as an artifact" +inputs: + version: + description: "Version number" + required: true +runs: + using: "composite" + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Validate + shell: bash + run: echo TODO Validate Terraform + + - name: Upload artifact + uses: actions/actions/upload-artifact@v4 + with: + path: "infrastructure" + name: iam-infrastructure-${{ inputs.version }} diff --git a/.github/workflows/stage-3-build.yaml b/.github/workflows/stage-3-build.yaml index 201d5b1..e93a5d4 100644 --- a/.github/workflows/stage-3-build.yaml +++ b/.github/workflows/stage-3-build.yaml @@ -44,23 +44,18 @@ jobs: uses: ./.github/actions/build-docs with: version: "${{ inputs.version }}" - artefact-1: - name: "Artefact 1" + artefact-terraform: + name: "Package Terraform" runs-on: ubuntu-latest timeout-minutes: 3 steps: - name: "Checkout code" uses: actions/checkout@v4 - - name: "Build artefact 1" - run: | - echo "Building artefact 1 ..." - - name: "Check artefact 1" - run: | - echo "Checking artefact 1 ..." - - name: "Upload artefact 1" - run: | - echo "Uploading artefact 1 ..." - # TODO: Use either action/cache or action/upload-artifact + + - name: "Upload artifact" + uses: ./.github/actions/package-terraform + with: + version: "${{ inputs.version }}" artefact-n: name: "Artefact n" runs-on: ubuntu-latest