Create main.yml

First build and deploy
This commit is contained in:
Rolf Martin Glomsrud 2023-02-26 02:37:55 +01:00 committed by GitHub
parent d7341269c9
commit 69e566c781
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

35
.github/workflows/main.yml vendored Normal file
View file

@ -0,0 +1,35 @@
name: Build and deploy to prod!
on:
push:
branches:
-master
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Install Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
- name: Add wasm with rustup
run: |
rustup target add wasm32-unknown-unknown
- name: build-wasm-file
run: |
cargo build --target wasm32-unknown-unknown --release
- name: move index.html into target
run: |
cp index.html target/wasm32-unknown-unknown/release/index.html
- name: rsync files
uses: burnett01/rsync-deployments@5.2
with:
switches: -avzr --delete
path: target/wasm32-unknown-unknown/release/
remote_path: /home/beepsort/deploy
remote_host: ${{ secrets.SERVER_IP }}
remote_user: ${{ beepsort }}
remote_key: ${{ secrets.SSH_PRIVATE_KEY }}
remote_port: ${{ 6969 }}