Manual-Tests-and-Release #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### This workflow will run only when triggered manually ### | |
### Full integration test is done by doing a plan, build and destroy of config under ./tests/auto_test1 ### | |
### If tests are successful a new version is released ### | |
name: "Manual-Tests-and-Release" | |
on: | |
workflow_dispatch: | |
jobs: | |
manual_plan_apply_destroy: | |
runs-on: ubuntu-latest | |
permissions: | |
pull-requests: write | |
issues: write | |
actions: read | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
- name: Plan AND Apply AND Destroy | |
uses: Pwd9000-ML/[email protected] | |
with: | |
test_type: plan-apply-destroy ## (Required) Valid options are "plan", "plan-apply", "plan-apply-destroy". Default="plan" | |
path: "tests/auto_test1" ## (Optional) Specify path to test module to run. | |
tf_version: latest ## (Optional) Specifies version of Terraform to use. e.g: 1.1.0 Default="latest" | |
tf_vars_file: testing.auto.tfvars ## (Required) Specifies Terraform TFVARS file name inside module path (Testing vars) | |
tf_key: tf-mod-tests-openai-gptui ## (Required) AZ backend - Specifies name that will be given to terraform state file and plan artifact (testing state) | |
az_resource_group: Terraform-GitHub-Backend ## (Required) AZ backend - AZURE Resource Group hosting terraform backend storage account | |
az_storage_acc: tfgithubbackendsa ## (Required) AZ backend - AZURE terraform backend storage account | |
az_container_name: gh-openai-gpt ## (Required) AZ backend - AZURE storage container hosting state files | |
arm_client_id: ${{ secrets.ARM_CLIENT_ID }} ## (Required - Actions Secrets) ARM Client ID | |
arm_client_secret: ${{ secrets.ARM_CLIENT_SECRET }} ## (Required - Actions Secrets) ARM Client Secret | |
arm_subscription_id: ${{ secrets.ARM_SUBSCRIPTION_ID }} ## (Required - Actions Secrets) ARM Subscription ID | |
arm_tenant_id: ${{ secrets.ARM_TENANT_ID }} ## (Required - Actions Secrets) ARM Tenant ID | |
github_token: ${{ secrets.GITHUB_TOKEN }} ## (Required) Needed to comment output on PR's. ${{ secrets.GITHUB_TOKEN }} already has permissions. | |
##### If tests are successful update all readme documentation using terraform-docs ##### | |
update_docs: | |
needs: manual_plan_apply_destroy | |
runs-on: ubuntu-latest | |
permissions: | |
pull-requests: write | |
repository-projects: write | |
contents: write | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
with: | |
ref: ${{ github.event.pull_request.head.ref }} | |
- name: Render terraform docs inside the README.md and push changes back to PR branch | |
uses: terraform-docs/[email protected] | |
with: | |
find-dir: . | |
output-file: README.md | |
output-method: inject | |
git-push: "true" | |
##### Create and automate new release based on next patch version of releases ##### | |
release_new_version: | |
needs: update_docs | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Determine version | |
id: version | |
uses: zwaldowski/semver-release-action@v3 | |
with: | |
bump: major | |
dry_run: true | |
github_token: ${{secrets.GITHUB_TOKEN}} | |
- name: Create new release and push to registry | |
id: release | |
uses: ncipollo/[email protected] | |
with: | |
generateReleaseNotes: true | |
name: "v${{ steps.version.outputs.version }}" | |
tag: ${{ steps.version.outputs.version }} | |
token: ${{ secrets.GITHUB_TOKEN }} |