You've already forked terraform-bunnynet
Deploy Configuration / Terraform Plan (git.rznet.fr) (push) Successful in 51s
Deploy Configuration / Terraform Plan (mirror.rznet.fr) (push) Failing after 6s
Deploy Configuration / Terraform Apply (git.rznet.fr) (push) Has been skipped
Deploy Configuration / Terraform Apply (mirror.rznet.fr) (push) Has been skipped
93 lines
2.3 KiB
YAML
93 lines
2.3 KiB
YAML
name: Deploy Configuration
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
pull_request:
|
|
branches: [ main ]
|
|
|
|
env:
|
|
TF_VERSION: "1.5.7"
|
|
|
|
jobs:
|
|
terraform-plan:
|
|
name: Terraform Plan
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
website: ["git.rznet.fr", "mirror.rznet.fr"]
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Terraform
|
|
uses: hashicorp/setup-terraform@v2
|
|
with:
|
|
terraform_version: ${{ env.TF_VERSION }}
|
|
|
|
- name: Terraform Init
|
|
id: init
|
|
working-directory: ${{ matrix.website }}
|
|
run: terraform init
|
|
|
|
- name: Terraform Format
|
|
id: fmt
|
|
working-directory: ${{ matrix.website }}
|
|
run: terraform fmt -check
|
|
|
|
- name: Terraform Validate
|
|
id: validate
|
|
working-directory: ${{ matrix.website }}
|
|
run: terraform validate
|
|
|
|
- name: Terraform Plan
|
|
id: plan
|
|
working-directory: ${{ matrix.website }}
|
|
run: terraform plan -no-color -out=terraform.tfplan
|
|
continue-on-error: true
|
|
|
|
- name: Terraform Plan Status
|
|
if: steps.plan.outcome == 'failure'
|
|
run: exit 1
|
|
|
|
- name: Save Terraform Plan
|
|
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: terraform-plan-${{ matrix.website }}
|
|
path: ${{ matrix.website }}/terraform.tfplan
|
|
|
|
terraform-apply:
|
|
name: Terraform Apply
|
|
needs: terraform-plan
|
|
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
website: ["git.rznet.fr", "mirror.rznet.fr"]
|
|
environment:
|
|
name: production
|
|
url: https://${{ matrix.website }}
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Terraform
|
|
uses: hashicorp/setup-terraform@v2
|
|
with:
|
|
terraform_version: ${{ env.TF_VERSION }}
|
|
|
|
- name: Download Terraform Plan
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: terraform-plan-${{ matrix.website }}
|
|
path: ${{ matrix.website }}
|
|
|
|
- name: Terraform Apply
|
|
working-directory: ${{ matrix.website }}
|
|
run: terraform apply -auto-approve terraform.tfplan
|
|
env:
|
|
BUNNYNET_API_KEY: ${{ secrets.BUNNYNET_API_KEY }}
|