diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml new file mode 100644 index 0000000..6d47dd8 --- /dev/null +++ b/.github/workflows/deploy.yaml @@ -0,0 +1,31 @@ +name: gh-pages-deploy + +on: + push: + branches: [main] + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Setup Go + uses: actions/setup-go@v4 + with: + go-version: '1.21.x' + + - name: Install dependencies + run: go get . + + - name: Test with Go CLI + run: go test ./... + + - name: Build WASM + run: GOOS=js GOARCH=wasm go build -o ./web/public/chip8.wasm ./web/web.go + + - name: deploy + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./web/public diff --git a/web/chip8.wasm b/web/chip8.wasm deleted file mode 100755 index 20ffedf..0000000 Binary files a/web/chip8.wasm and /dev/null differ diff --git a/web/index.html b/web/public/index.html similarity index 100% rename from web/index.html rename to web/public/index.html diff --git a/web/js/polyfill.js b/web/public/js/polyfill.js similarity index 100% rename from web/js/polyfill.js rename to web/public/js/polyfill.js diff --git a/web/js/wasm_exec.js b/web/public/js/wasm_exec.js similarity index 100% rename from web/js/wasm_exec.js rename to web/public/js/wasm_exec.js diff --git a/web/js/wasm_load.js b/web/public/js/wasm_load.js similarity index 100% rename from web/js/wasm_load.js rename to web/public/js/wasm_load.js