Skip to content

Commit

Permalink
Create main.yml
Browse files Browse the repository at this point in the history
Create GitHub Action
  • Loading branch information
Jinnkunn authored Feb 23, 2024
1 parent 70f9696 commit 6b12a23
Showing 1 changed file with 78 additions and 0 deletions.
78 changes: 78 additions & 0 deletions .github/workflows/main.yml
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

0 comments on commit 6b12a23

Please sign in to comment.