Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
ozanoguz committed Dec 8, 2023
1 parent 110fe80 commit 3d6bf4c
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 3 deletions.
85 changes: 85 additions & 0 deletions .github/workflows/fgt-tf-standalone-existing-vcn.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: '[FGT] TF - Standalone - Existing-VCN'

env:
TFPath: FortiGate/Standalone/Existing-VCN/terraform/
ZIPfile: tf-fgt-standalone-existingvcn.zip

on:
workflow_dispatch:
push:
branches:
- main
paths:
- 'FortiGate/Standalone/Existing-VCN/terraform/*.tf'
- 'FortiGate/Standalone/Existing-VCN/terraform/*.tpl'
- 'FortiGate/Standalone/Existing-VCN/terraform/*.hcl'

jobs:
OCI-FGT-TF-Standalone:
name: 'Terraform FortiGate Standalone'
runs-on: ubuntu-latest
env:
TF_VAR_tenancy_ocid: "${{ secrets.TENANCY_OCID }}"
TF_VAR_compartment_ocid: "${{ secrets.COMPARTMENT_OCID }}"
TF_VAR_user_ocid: "${{ secrets.USER_OCID }}"
TF_VAR_region: "${{ secrets.REGION }}"
TF_VAR_fingerprint: "${{ secrets.FINGERPRINT }}"
TF_VAR_private_key_path: ~/.oci/oci_api_key.pem

steps:
- name: "Checkout"
uses: actions/checkout@v4

- name: "Setup Terraform"
uses: hashicorp/setup-terraform@v3

- name: Configure OCI credentials
run: |
mkdir -p ~/.oci
echo "${{ secrets.OCI_PEM_KEY }}" > ~/.oci/oci_api_key.pem
chmod 600 ~/.oci/oci_api_key.pem
- name: "Terraform Init"
id: init
run: terraform init
working-directory: ${{ env.TFPath }}

- name: "Terraform Validation"
id: validate
run: terraform validate
working-directory: ${{ env.TFPath }}

- name: "Terraform Format"
id: format
run: terraform fmt -check -diff
working-directory: ${{ env.TFPath }}

- name: "Terraform Plan"
id: plan
run: terraform plan -out plan.tfplan
working-directory: ${{ env.TFPath }}

- name: "Terraform Show"
id: show
run: terraform show -json plan.tfplan
working-directory: ${{ env.TFPath }}

- name: "Save Plan JSON"
run: echo '${{ steps.show.outputs.stdout }}' > plan.json # Do not change

- name: Package and convert templates
uses: azure/powershell@v1
with:
inlineScript: |
Compress-Archive -Path "./FortiGate/Standalone/Existing-VCN/*" -DestinationPath "./${{ env.ZIPfile }}"
azPSVersion: "latest"

- name: upload-templates-zip
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{secrets.GITHUB_TOKEN}}
file: ./${{ env.ZIPfile }}
asset_name: ${{ env.ZIPfile }}
tag: fgtstandalone
overwrite: true
body: "OCI FortiGate Standalone"
6 changes: 3 additions & 3 deletions .github/workflows/fgt-tf-standalone-new-vcn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: '[FGT] TF - Standalone - New-VCN'

env:
TFPath: FortiGate/Standalone/New-VCN/terraform/
ZIPfile: tf-fgt-standalone.zip
ZIPfile: tf-fgt-standalone-newvcn.zip

on:
workflow_dispatch:
Expand All @@ -16,7 +16,7 @@ on:

jobs:
OCI-FGT-TF-Standalone:
name: 'Terraform A-Single-VM'
name: 'Terraform FortiGate Standalone'
runs-on: ubuntu-latest
env:
TF_VAR_tenancy_ocid: "${{ secrets.TENANCY_OCID }}"
Expand Down Expand Up @@ -80,6 +80,6 @@ jobs:
repo_token: ${{secrets.GITHUB_TOKEN}}
file: ./${{ env.ZIPfile }}
asset_name: ${{ env.ZIPfile }}
tag: artefactstest
tag: fgtstandalone
overwrite: true
body: "OCI FortiGate Standalone"

0 comments on commit 3d6bf4c

Please sign in to comment.