try using github actions instead #4
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 and Deploy Web Version | |
on: | |
push: | |
branches: [ axis ] | |
pull_request: | |
branches: [ axis ] | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
- name: Set up Emscripten | |
uses: mymindstorm/setup-emsdk@v12 | |
with: | |
version: '3.1.45' | |
- name: Install Dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y build-essential clang lld cmake ninja-build pkg-config | |
- name: Install xmake | |
run: | | |
wget https://xmake.io/shget.text -O - | bash | |
source ~/.xmake/profile | |
- name: Build for Web (WASM) | |
run: | | |
xmake f -p wasm -y | |
xmake -y | |
- name: Prepare artifacts | |
run: | | |
mkdir -p netlify-build | |
cp -r build/clay/* netlify-build/ | |
cp index.html netlify-build/ | |
cp manifest.json netlify-build/ | |
cp -r fonts netlify-build/ | |
cp -r images netlify-build/ | |
- name: Deploy to Netlify | |
uses: nwtgck/actions-netlify@v2 | |
with: | |
publish-dir: './netlify-build' | |
production-deploy: true | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
netlify-auth-token: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
netlify-site-id: ${{ secrets.NETLIFY_SITE_ID }} | |
env: | |
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} |