windows integration + work with update_tfstate

This commit is contained in:
miampf 2024-04-19 10:40:06 +02:00
parent eaba60d182
commit 774fb3f060
No known key found for this signature in database
GPG Key ID: EF039364B5B6886C
2 changed files with 28 additions and 2 deletions

View File

@ -11,12 +11,15 @@ inputs:
encryptionSecret:
description: "The encryption secret for the artifacts."
required: true
skipDeletion:
description: "Don't try to delete the artifact before updating. You should only use this if you know that no artifact exists."
default: false
runs:
using: "composite"
steps:
- name: Check if tfstate should be deleted
if: always()
if: always() && !${{ inputs.skipDeletion }}
shell: bash
run: |
if [ ! -d constellation-terraform ] && [ ! -d constellation-iam-terraform ]; then
@ -26,7 +29,7 @@ runs:
fi
- name: Delete tfstate artifact if necessary
if: always() && env.DELETE_TF_STATE == 'true'
if: always() && env.DELETE_TF_STATE == 'true' && !${{ inputs.skipDeletion }}
uses: ./.github/actions/artifact_delete
with:
name: ${{ inputs.name }}

View File

@ -195,3 +195,26 @@ jobs:
test: Windows E2E Test
provider: Azure
attestationVariant: "azure-sev-snp"
upload-tfstate:
name: Upload terraform state if it exists
runs-on: ubuntu-22.04
needs: e2e-test
if: always()
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
ref: ${{ !github.event.pull_request.head.repo.fork && github.head_ref || '' }}
- name: Upload tfstate
if: always()
env:
GH_TOKEN: ${{ github.token }}
uses: ./.github/actions/update_tfstate
with:
name: terraform-state-${{ github.run_id }}
runID: ${{ github.run_id }}
encryptionSecret: ${{ secrets.ARTIFACT_ENCRYPT_PASSWD }}
skipDeletion: true