Skip to content

Commit

Permalink
[blocked on 0.14] ci: add gen deploy (#1067)
Browse files Browse the repository at this point in the history
* ci: add gen deploy


---------

Co-authored-by: Elad Kaplan <[email protected]>
  • Loading branch information
jondot and kaplanelad authored Jan 15, 2025
1 parent 6114163 commit 0d30d4b
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
43 changes: 43 additions & 0 deletions .github/workflows/loco-gen-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: "[loco-gen-deploy]"

on:
push:
branches:
- master
pull_request:

env:
RUST_TOOLCHAIN: stable
TOOLCHAIN_PROFILE: minimal

jobs:
g-deploy-docker:
runs-on: ubuntu-latest

permissions:
contents: read

steps:
- name: Checkout the code
uses: actions/checkout@v4
- 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 --path ./loco-new
- name: create myapp
run: |
loco new -n myapp --db sqlite --bg async --assets serverside -a
- name:
run: cargo loco generate deployment --kind docker && docker build -t demo .
working-directory: ./myapp

2 changes: 1 addition & 1 deletion loco-gen/src/templates/deployment/docker/docker.t
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ COPY --from=builder /usr/src/{{fallback_file}} /usr/app/{{fallback_file}}
COPY --from=builder /usr/src/config /usr/app/config
COPY --from=builder /usr/src/target/release/{{pkg_name}}-cli /usr/app/{{pkg_name}}-cli

ENTRYPOINT ["/usr/app/{{pkg_name}}-cli"]
ENTRYPOINT ["/usr/app/{{pkg_name}}-cli"]

0 comments on commit 0d30d4b

Please sign in to comment.