Updates #33
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 | |
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: Prepare Filesystem | |
run: | | |
mkdir -p ./.build | |
- name: Create Butane YAML with Terraform | |
run: | | |
pushd ./terraform | |
echo "Initialising Terraform..." | |
terraform init | |
echo "Applying Terraform..." | |
terraform apply -auto-approve | |
echo "Starting index page..." | |
echo "<html><head><title>Butane</title><body><h1>Butane</h1><p>Deployed by Terraform</p><ul>" > ../.build/index.html | |
echo "Getting Terraform JSON outputs..." | |
for i in "plex" "swarm_manager" "swarm_worker" "k3s"; do | |
echo " ... ${i}" | |
terraform output -raw ${i} > ../.build/${i}.json | |
echo "<li><a href=\"${i}.json\">${i}</a></li>" >> ../.build/index.html | |
done | |
echo "Closing index page..." | |
echo "</ul></body></html>" >> ../.build/index.html | |
popd | |
- name: Deploy | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
folder: .build |