quix-aks module CI/CD #20
This file contains hidden or 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
| name: quix-aks module CI/CD | |
| on: | |
| push: | |
| branches: [ main, dev ] | |
| paths: | |
| - 'modules/quix-aks/**' | |
| - 'modules/tiered-storage/**' | |
| - '.github/workflows/terraform-module.yml' | |
| workflow_dispatch: | |
| inputs: | |
| bump: | |
| description: 'Version bump (patch, minor, major)' | |
| required: true | |
| default: 'minor' | |
| type: choice | |
| options: [patch, minor, major] | |
| permissions: | |
| contents: write | |
| jobs: | |
| validate: | |
| name: Validate Terraform | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ${{ matrix.module }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| module: [ 'modules/quix-aks', 'modules/tiered-storage' ] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Terraform | |
| uses: hashicorp/setup-terraform@v3 | |
| with: | |
| terraform_version: 1.6.6 | |
| - name: Terraform fmt | |
| run: terraform fmt -check -recursive | |
| - name: Terraform init (no backend) | |
| run: terraform init -backend=false | |
| - name: Terraform validate | |
| run: terraform validate | |
| - name: Generate terraform-docs (inject & commit) | |
| uses: terraform-docs/[email protected] | |
| with: | |
| working-dir: ${{ matrix.module }} | |
| output-file: README.md | |
| output-method: inject | |
| config-file: '' | |
| git-push: true | |
| release: | |
| name: Tag release | |
| runs-on: ubuntu-latest | |
| needs: validate | |
| # Only release on manual dispatch with bump==minor | |
| if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.bump == 'minor' }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Create tag (SemVer bump) | |
| id: tag | |
| uses: anothrNick/[email protected] | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| DEFAULT_BUMP: ${{ github.event.inputs.bump }} | |
| TAG_PREFIX: 'v' | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| if: steps.tag.outputs.new_tag != '' | |
| with: | |
| tag_name: ${{ steps.tag.outputs.new_tag }} | |
| name: ${{ steps.tag.outputs.new_tag }} | |
| generate_release_notes: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |