Skip to content

Updates

Updates #26

Workflow file for this run

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" "hetzner" "hetzner_local"; 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