Open jordanpadams opened 7 months ago
Here is the prototypical staging.yaml
file that would achieve this:
---
name: 🎭 Staging
on:
push:
branches:
- staging
paths-ignore:
- 'CHANGELOG.md'
- 'docs/requirements/**'
workflow_dispatch:
jobs:
staging-delivery:
name: 📪 Staging Delivery
if: github.actor != 'pdsen-ci'
runs-on: ubuntu-latest
steps:
-
name: 💳 Checkout
uses: actions/checkout@v2
with:
lfs: true
token: ${{secrets.ADMIN_GITHUB_TOKEN}}
fetch-depth: 0
-
name: 🌍 Terraform Setup
uses: hashicorp/setup-terraform@v3
with:
terraform_version: "TERRAFORM_VERSION_HERE"
-
name: 🔬 Terraform initialization and validation
run: |
terraform init -no-color
terraform validate -no-color
-
name: 💥 Terraform destruction of any existing delivery
run: terraform apply -destroy -no-color -auto-approve
continue-on-error: true
env:
ANY_SECRET: ${{secrets.ANY_SECRET}}
etc: ${{secrets.etc}}
-
name: 🛫 Terraform application of new delivery
run: terraform apply -no-color -auto-approve
env:
ANY_SECRET: ${{secrets.ANY_SECRET}}
etc: ${{secrets.etc}}
...
This can be adapted for various repositories depending on their shapes and needs, of course, such as adding -var-file=FILE
, altering the secrets, and so on.
💡 Description
Merge to
staging
-> Deploy to Test venue⚔️ Parent Epic / Related Tickets
No response