Skip to content

Deploy static content to Pages #6

Deploy static content to Pages

Deploy static content to Pages #6

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: 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 &&
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 &&
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