Skip to content

Commit e44b7a8

Browse files
committed
heroku workflows
1 parent 58163f3 commit e44b7a8

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed

.github/workflows/main.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: CI
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: Build Docker image
13+
run: docker build -t registry.heroku.com/${{ secrets.HEROKU_APP }}/web:latest .
14+
15+
- name: Docker image info
16+
run: docker images
17+
18+
- name: Login to container registry
19+
env:
20+
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
21+
run: heroku container:login
22+
23+
- name: Push Docker image
24+
run: docker push registry.heroku.com/${{ secrets.HEROKU_APP }}/web
25+
26+
- name: Release
27+
env:
28+
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
29+
run: heroku container:release -a ${{ secrets.HEROKU_APP }} web

Dockerfile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Use a Rust image with a specific version
2+
FROM rust:1.60 as build
3+
4+
# Set the working directory inside the container
5+
WORKDIR /holy
6+
7+
# Copy only the necessary files for dependency resolution
8+
COPY ./Cargo.lock ./Cargo.lock
9+
COPY ./Cargo.toml ./Cargo.toml
10+
11+
# Build dependencies only (to cache them)
12+
RUN cargo build --release
13+
14+
# Copy the rest of your application source code
15+
COPY ./src ./src
16+
17+
# Build the application
18+
RUN cargo build --release
19+
20+
# Start a new build stage
21+
FROM debian:buster-slim
22+
23+
# Copy the built binary from the previous stage
24+
COPY --from=build /holy/target/release/holy .
25+
26+
# Set the command to run your binary
27+
CMD ["./holy"]

0 commit comments

Comments
 (0)