test #3
This file contains hidden or 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: | |
| branches: ["main"] | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.24" | |
| check-latest: true | |
| - name: Build WASM | |
| run: | | |
| cd wasm-build | |
| go get -u github.com/php-any/origami@main | |
| go mod tidy | |
| GOOS=js GOARCH=wasm go build -o ../public/wasm/origami.wasm . | |
| # Copy wasm_exec.js from GOROOT to public folder | |
| cp $(go env GOROOT)/misc/wasm/wasm_exec.js ../public/wasm_exec.js | |
| cd .. | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: "npm" | |
| - name: Install Dependencies | |
| run: npm install | |
| - name: Build Frontend | |
| run: npm run build | |
| - name: Deploy to GitHub Pages | |
| uses: JamesIves/github-pages-deploy-action@v4 | |
| with: | |
| folder: dist | |
| branch: gh-pages |