47 lines
1.3 KiB
YAML
47 lines
1.3 KiB
YAML
name: "[loco-gen-deploy]"
|
|
on:
|
|
schedule:
|
|
- cron: "0 0 * * *"
|
|
|
|
env:
|
|
RUST_TOOLCHAIN: stable
|
|
TOOLCHAIN_PROFILE: minimal
|
|
|
|
jobs:
|
|
g-deploy-docker:
|
|
# This workflow creates a new Loco application and builds a Docker image
|
|
# We only want this to run on the main repository (loco-rs/loco) and not on forks because:
|
|
# 1. It consumes GitHub Actions minutes unnecessarily on forks
|
|
# 2. The Docker build and deployment is specific to the main repository
|
|
# 3. Forks typically don't need to run this automated deployment process
|
|
if: github.repository == 'loco-rs/loco'
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
steps:
|
|
- name: Checkout the code
|
|
uses: actions/checkout@v7
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
toolchain: ${{ env.RUST_TOOLCHAIN }}
|
|
- name: Setup Rust cache
|
|
uses: Swatinem/rust-cache@v2
|
|
|
|
- name: Install seaorm cli
|
|
run: cargo install sea-orm-cli
|
|
|
|
- name: install 'loco new'
|
|
run: |
|
|
cargo install loco
|
|
|
|
- name: create myapp
|
|
run: |
|
|
loco new -n myapp --db sqlite --bg async --assets serverside -a
|
|
|
|
- name:
|
|
run: cargo loco generate deployment docker && docker build -t demo .
|
|
working-directory: ./myapp
|
|
|