Skip to content

Commit

Permalink
add deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Steinke committed Feb 7, 2024
1 parent 5749653 commit 5f386db
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 4 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 'stable'
- run: make build
- uses: actions/upload-pages-artifact


# Deploy job
deploy:
# Add a dependency to the build job
needs: build

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
main.wasm
wasm_exec.js
web
_site
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
build:
GOARCH=wasm GOOS=js go build -o web/app.wasm
cp styles.css web/
GOARCH=wasm GOOS=js go build -o _site/app.wasm
cp styles.css _site/

vim:
GOOS=js GOARCH=wasm nvim
Expand Down
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ func main() {
Name: "Simon Says",
Description: "A game of simon says",
Styles: []string{
"/web/styles.css",
"/_site/styles.css",
},
Resources: app.LocalDir("_site"),
})

if err := http.ListenAndServe(":8000", nil); err != nil {
Expand Down

0 comments on commit 5f386db

Please sign in to comment.