Skip to content

Commit

Permalink
heroku workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
igorvieira committed Apr 6, 2024
1 parent 58163f3 commit 797900c
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/main.yml
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
19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM rust:1.62 as build

RUN USER=root cargo new --bin holy
WORKDIR /holy

COPY ./Cargo.lock ./Cargo.lock
COPY ./Cargo.toml ./Cargo.toml
RUN cargo build --release

RUN rm src/*.rs
COPY ./src ./src

RUN rm ./target/release/deps/holy*
RUN cargo build --release

FROM debian:buster-slim
COPY --from=build /holy/target/release/holy .

CMD ["./holy"]

0 comments on commit 797900c

Please sign in to comment.