Skip to content

Deploy static content to Pages #23

Deploy static content to Pages

Deploy static content to Pages #23

Workflow file for this run

name: Deploy static content to Pages
on:
workflow_run:
workflows:
- Build and test PWA image
branches:
- main
types:
- completed
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Install wget
run: sudo apt-get update && sudo apt-get install -y wget
- name: Install Tailwind CLI
run: |
wget https://github.com/tailwindlabs/tailwindcss/releases/download/v3.4.14/tailwindcss-linux-x64 &&
chmod +x tailwindcss-linux-x64 &&
sudo mv tailwindcss-linux-x64 /usr/bin/tailwindcss
- name: Setup Go environment
uses: actions/setup-go@v5.0.2
with:
go-version: '1.23.2'
- name: Build static files
env:
BUILD_STATIC: "true"
run: |
cd pwa &&
mkdir -p ./app/web &&
mv ./web/* ./app/web/ &&
echo -n ${{ vars.FLUSH_API_URL }} > ./app/web/apiurl &&
GOARCH=wasm GOOS=js go build -o ./app/web/app.wasm ./main/main.go &&
BUILD_STATIC=true go build -o ./flush-log ./main/main.go &&
./flush-log &&
tailwindcss -i ./app/web/tailwind-input.css -o ./app/web/style.css --minify
ls -ltrRa &&
mv ./*.html ./*.webmanifest ./*.js ./*.css ./app &&
mv app ..
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: './app'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4