Skip to content

Commit f699b02

Browse files
committed
heroku workflows
1 parent 58163f3 commit f699b02

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-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: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM rust:1.60 as build
2+
3+
RUN USER=root cargo new --bin holy
4+
WORKDIR /holy
5+
6+
COPY ./Cargo.lock ./Cargo.lock
7+
COPY ./Cargo.toml ./Cargo.toml
8+
RUN cargo build --release
9+
10+
RUN rm src/*.rs
11+
COPY ./src ./src
12+
13+
RUN rm ./target/release/deps/holy*
14+
RUN cargo build --release
15+
16+
FROM debian:buster-slim
17+
COPY --from=build /holy/target/release/holy .
18+
19+
CMD ["./holy"]

0 commit comments

Comments
 (0)