57 lines
1.6 KiB
YAML
57 lines
1.6 KiB
YAML
name: Deploy to Shuttle
|
|
|
|
on:
|
|
pull_request:
|
|
branches: [master]
|
|
types: [closed]
|
|
|
|
jobs:
|
|
deploy:
|
|
if: github.event.pull_request.merged == true
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
# Install wasm32-unknown-unknown target
|
|
- name: Install wasm32-unknown-unknown target
|
|
run: rustup target add wasm32-unknown-unknown
|
|
|
|
# Build frontend
|
|
- name: Install Node.js
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 16
|
|
- name: Install Tailwind CSS
|
|
run: npm install -D tailwindcss
|
|
working-directory: ./frontend
|
|
- name: Install trunk
|
|
run: cargo install trunk
|
|
- name: Rename Trunk.toml
|
|
run: mv Trunk.toml Trunk.bkp
|
|
working-directory: ./frontend
|
|
- name: Build frontend
|
|
run: trunk build --release
|
|
working-directory: ./frontend
|
|
- name: Rename Trunk.toml back
|
|
run: mv Trunk.bkp Trunk.toml
|
|
working-directory: ./frontend
|
|
|
|
# Deploy backend
|
|
- name: Install Rust
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: stable
|
|
override: true
|
|
- name: Deploy to shuttle.rs
|
|
uses: shuttle-hq/deploy-action@main
|
|
with:
|
|
allow-dirty: "true"
|
|
deploy-key: ${{ secrets.SHUTTLE_TOKEN }}
|
|
# run: cargo install --locked cargo-shuttle
|
|
# - name: Deploy to Shuttle
|
|
# env:
|
|
# SHUTTLE_TOKEN: ${{ secrets.SHUTTLE_TOKEN }}
|
|
# run: |
|
|
# cargo shuttle login --api-key $SHUTTLE_TOKEN
|
|
# cargo shuttle deploy
|