Updated workflow #5
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
name: Build and Deploy | |
on: | |
- push | |
permissions: | |
contents: write | |
jobs: | |
Build: | |
concurrency: ci-${{ github.ref }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup Terraform | |
uses: hashicorp/setup-terraform@v3 | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Create Butane YAML with Terraform | |
run: | | |
pushd ./terraform | |
echo "Initialising Terraform..." | |
terraform init | |
echo "Applying Terraform..." | |
terraform apply -auto-approve | |
echo "Getting Terraform JSON outputs..." | |
mkdir -p ./.build | |
for i in "plex" "swarm_manager" "swarm_worker"; do | |
echo " ... ${i}" | |
terraform output -raw ${i} > ../.build/${i}.json | |
done | |
popd | |
- name: Deploy | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
folder: .build |