Skip to content

Fix Github Actions

Fix Github Actions #5

Workflow file for this run

name: Rust
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
DATABASE_URL: postgres://dennis@localhost/food_calc_testing
jobs:
build:
runs-on: ubuntu-latest
environment: ssh
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: ""
POSTGRES_USER: dennis
POSTGRES_DB: food_calc_testing
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3
- name: Load Sample Data
run: psql -p 5432 -h localhost -U dennis --no-password -f foodlib/sample_data/food_calc.sql food_calc_testing
- name: Build
run: cargo build --verbose --release
- name: Run tests
run: cargo test --verbose
- name: Deploy to Server
uses: easingthemes/ssh-deploy@main
with:
SSH_PRIVATE_KEY: ${{ secrets.DEPLOY_KEY }}
REMOTE_USER: ${{ secrets.DEPLOY_USER }}
REMOTE_HOST: ${{ secrets.DEPLOY_HOST }}
REMOTE_PORT: ${{ secrets.DEPLOY_PORT }}
SOURCE: target/release/
TARGET: /srv/foodcalc
SCRIPT_AFTER: echo $RSYNC_STDOUT