-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
58163f3
commit f3fac7e
Showing
2 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: CI | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Build Docker image | ||
run: docker build -t registry.heroku.com/${{ secrets.HEROKU_APP }}/web:latest . | ||
|
||
- name: Docker image info | ||
run: docker images | ||
|
||
- name: Login to container registry | ||
env: | ||
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }} | ||
run: heroku container:login | ||
|
||
- name: Push Docker image | ||
run: docker push registry.heroku.com/${{ secrets.HEROKU_APP }}/web | ||
|
||
- name: Release | ||
env: | ||
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }} | ||
run: heroku container:release -a ${{ secrets.HEROKU_APP }} web |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Use a Rust image with a specific version | ||
FROM rust:1.60 as build | ||
|
||
# Set the working directory inside the container | ||
WORKDIR /holy | ||
|
||
# Copy only the necessary files for dependency resolution | ||
COPY Cargo.lock Cargo.toml ./ | ||
|
||
# Build dependencies only (to cache them) | ||
RUN cargo build --release | ||
|
||
# Copy the rest of your application source code | ||
COPY src ./src | ||
|
||
# Build the application | ||
RUN cargo build --release | ||
|
||
# Start a new build stage | ||
FROM debian:buster-slim | ||
|
||
# Set the working directory | ||
WORKDIR /usr/src/app | ||
|
||
# Copy the built binary from the previous stage | ||
COPY --from=build /holy/target/release/holy . | ||
|
||
# Set the command to run your binary | ||
CMD ["./holy"] | ||
|