some fixes on go package name, trying to deploy to digital ocean #3
Workflow file for this run
This file contains 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: Release new version | |
on: | |
push: | |
branches: | |
- "dev" | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
env: | |
GOOS: js | |
GOARCH: wasm | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: 1.21.x | |
cache: true | |
- name: Build wasm | |
run: | | |
go build -o ./web/mykeys.wasm ./cmd/webassembly/main.go | |
- name: Copy go wasm js engine | |
run: | | |
cp "$(go env GOROOT)/misc/wasm/wasm_exec.js" ./web | |
- name: Install doctl | |
uses: digitalocean/action-doctl@v2 | |
with: | |
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} | |
- name: Build container image | |
run: docker build -t ${{ secrets.REGISTRY_NAME }}/mykeys:$(echo $GITHUB_SHA | head -c7) . | |
- name: Log in to DigitalOcean Container Registry with short-lived credentials | |
run: doctl registry login | |
- name: Push image to DigitalOcean Container Registry | |
run: docker push ${{ secrets.REGISTRY_NAME }}/mykeys:$(echo $GITHUB_SHA | head -c7) |