Build and ship frontend in deploy.yml

This commit is contained in:
Tyler Hallada 2023-10-20 00:12:38 -04:00
parent 68fed43a5a
commit 3cb33a5d34

View File

@ -14,22 +14,35 @@ jobs:
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- run: rustup toolchain install stable --profile minimal
- uses: Swatinem/rust-cache@v2
- name: Cache Cargo binaries - name: Cache Cargo binaries
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
path: ~/.cargo/bin path: ~/.cargo/bin
- uses: extractions/setup-just@v1
- uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Install frontend
run: bun install --frozen-lockfile --cwd frontend
- name: Build frontend
run: just build-frontend
- run: rustup toolchain install stable --profile minimal
- uses: Swatinem/rust-cache@v2
- name: Install sqlx-cli - name: Install sqlx-cli
run: cargo install sqlx-cli --no-default-features --features native-tls,postgres run: cargo install sqlx-cli --no-default-features --features native-tls,postgres
- name: Run tests - name: Run tests
run: cargo test --verbose run: cargo test --verbose
- name: Build - name: Build backend
run: cargo build --release --verbose run: cargo build --release --verbose
- name: Install SSH Key - name: Install SSH Key
@ -41,5 +54,8 @@ jobs:
- name: Adding Known Hosts - name: Adding Known Hosts
run: ssh-keyscan -H ${{ secrets.SSH_HOST }} >> ~/.ssh/known_hosts run: ssh-keyscan -H ${{ secrets.SSH_HOST }} >> ~/.ssh/known_hosts
- name: Deploy with rsync - name: Deploy frontend with rsync
run: rsync -avz ./static/ ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:/home/crawlnicle/crawlnicle/static/
- name: Deploy backend with rsync
run: rsync -avz ./target/ ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:/home/crawlnicle/crawlnicle/target/ run: rsync -avz ./target/ ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:/home/crawlnicle/crawlnicle/target/