build-wasm #5
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: build-wasm | |
on: | |
workflow_dispatch: | |
# push: | |
# branches: [ "main" ] | |
# pull_request: | |
# branches: [ "main" ] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: jetli/wasm-pack-action@v0.3.0 | |
with: | |
version: 'latest' | |
- name: Build WASM | |
working-directory: ./ghg | |
run: wasm-pack build --target web --out-dir www/wasm | |
- name: Prepare Stage | |
run: | | |
git config user.name "github_actions[bot]" | |
git config user.email "github_actions[bot]@users.noreply.github.com" | |
git push --delete origin gh-pages-stage &>/dev/null | |
git switch -c gh-pages-stage | |
- name: Fix .gitignore | |
run: | | |
echo "Replacing .gitignore" | |
sed -i -n '/DEPLOY_TAG/q;p' .gitignore | |
rm ghg/www/wasm/.gitignore | |
echo "Success" | |
- name: Stage Artifacts | |
run: | | |
git status | |
git add . | |
git commit -m ":robot: Add build artifacts" | |
git push -u origin gh-pages-stage |