-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create GitHub Action
- Loading branch information
Showing
1 changed file
with
78 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# This file is autogenerated by maturin v1.3.1 | ||
# To update, run | ||
# | ||
# maturin generate-ci github | ||
# | ||
name: Web | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- master | ||
tags: | ||
- '*' | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Dependencies | ||
run: | | ||
apt update -y && apt-get install clang -y | ||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y --profile=minimal --target=wasm32-unknown-unknown | ||
npm install -g wasm-pack | ||
- name: Build | ||
run: | | ||
cd ./web_assembly | ||
wasm-pack build --target=web --release --out-dir=../map/pkg | ||
- name: Deploy | ||
run: | | ||
npm install | ||
mkdir aisdb_web && cd aisdb_web && mkdir map && cd .. | ||
cd map | ||
export VITE_DISABLE_SSL_DB=1 | ||
export VITE_DISABLE_STREAM=1 | ||
export VITE_AISDBHOST=localhost | ||
export VITE_AISDBPORT=9924 | ||
npx vite build --outDir=../aisdb_web/dist_map | ||
export VITE_BINGMAPTILES=1 | ||
export VITE_TILESERVER=aisdb.meridian.cs.dal.ca | ||
npx vite build --outDir=../aisdb_web/dist_map_bingmaps | ||
cd .. | ||
mv ./map/pkg/ ./aisdb_web/map/ | ||
- name: zip dist | ||
run: | | ||
zip -r aisdb_web.zip aisdb_web | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: Release ${{ github.ref }} | ||
draft: true | ||
|
||
- name: Upload Release Asset | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./aisdb_web.zip | ||
asset_name: aisdb_web.zip | ||
asset_content_type: application/zip | ||
|