cors fix #13
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 Rust server | |
on: | |
workflow_dispatch: | |
push: | |
branches: [main] | |
jobs: | |
deploy_rust: | |
runs-on: ubuntu-latest | |
container: rust:slim-buster | |
env: | |
SQLX_OFFLINE: true | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install Dependencies | |
run: | | |
apt-get update | |
apt-get install -y libssl-dev pkg-config | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- name: Build Rust | |
run: cargo build --release --manifest-path ./packages/server/Cargo.toml | |
- name: Copy file via scp | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.IP }} | |
username: ${{ secrets.USERNAME }} | |
key: ${{ secrets.KEY }} | |
source: "packages/server/target/release/server" | |
target: "~/apps/next-rust-todolist/packages/server/target/release/" | |
strip_components: 4 | |
- uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.IP }} | |
username: ${{ secrets.USERNAME }} | |
key: ${{ secrets.KEY }} | |
script: | | |
cd apps/next-rust-todolist | |
git checkout . | |
git pull | |
docker-compose up -d --build |