Skip to content

Commit

Permalink
add initial pipeline setup
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasisnes committed Sep 30, 2024
1 parent afcf9fb commit 664438b
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 9 deletions.
28 changes: 21 additions & 7 deletions .github/workflows/infra-cd-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,27 @@ permissions:
jobs:
plan:
name: Plan
secrets: inherit
uses: ./.github/workflows/infra-ci-template.yml
with:
environment: ${{ inputs.environment }}
tf_state: ${{ inputs.tf_state }}
tf_args: ${{ inputs.tf_args }}
working_dir: ${{ inputs.working_dir }}
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Terraform Set TFVARS
run: echo "TF_VARS_FILE=$(echo ${{ inputs.environment }} | tr '[:upper:]' '[:lower:]').tfvars" >> $GITHUB_ENV

- name: Terraform Plan
uses: altinn/altinn-platform/actions/terraform/plan@main
with:
working_directory: ${{ inputs.working_dir }}
oidc_type: environment
oidc_value: ${{ inputs.environment }}

arm_client_id: ${{ vars.ARM_CLIENT_ID }}
arm_subscription_id: ${{ vars.ARM_SUBSCRIPTION_ID }}

tf_state_name: ${{ inputs.tf_state }}
tf_args: -var-file=${{ env.TF_VARS_FILE }} ${{ inputs.tf_args }}
gh_token: ${{ secrets.GITHUB_TOKEN }}

apply:
name: Deploy
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/infra-ci-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Terraform Set TFVARS
run: echo "TF_VARS_FILE=$(echo ${{ inputs.environment }} | tr '[:upper:]' '[:lower:]').tfvars" >> $GITHUB_ENV

- name: Terraform Initialize
- name: Terraform Plan
uses: altinn/altinn-platform/actions/terraform/plan@main
with:
working_directory: ${{ inputs.working_dir }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/libs-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@ jobs:

- name: Test
if: always()
working-directory: src/apps/${{ matrix.name }}
working-directory: ${{ env.DIR }}/${{ matrix.name }}
run: dotnet test --no-build

0 comments on commit 664438b

Please sign in to comment.