-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build and publish docker images (#22)
* Remove unknown type identifier for PostgreSQL * Add GH action building and pushing docker * Add Dockerfile
- Loading branch information
1 parent
8c6a091
commit c970337
Showing
5 changed files
with
57 additions
and
4 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,2 @@ | ||
target/ | ||
debug/ |
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,36 @@ | ||
name: build and upload docker image | ||
|
||
on: | ||
push: | ||
tags: | ||
- v[0-9]+.[0-9]+.[0-9]+ | ||
|
||
jobs: | ||
build-and-push: | ||
name: build-and-push | ||
|
||
runs-on: ubuntu-16.04 | ||
|
||
steps: | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Get ref | ||
id: parse_ref | ||
run: | | ||
echo ::set-output name=tag::${GITHUB_REF/refs\/tags\//} | ||
- name: Build and push | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
push: true | ||
tags: | | ||
p2panda/aquadoggo:latest | ||
p2panda/aquadoggo:${{ steps.parse_ref.outputs.tag }} |
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
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,15 @@ | ||
FROM ekidd/rust-musl-builder:latest AS BUILDER | ||
|
||
# Add source code with right permissions | ||
ADD --chown=rust:rust . ./ | ||
|
||
# Build our application | ||
RUN cargo build --release | ||
|
||
# Now, we need to build our _real_ Docker container, copying in `aquadoggo` | ||
FROM alpine:latest | ||
RUN apk --no-cache add ca-certificates | ||
COPY --from=BUILDER \ | ||
/home/rust/src/target/x86_64-unknown-linux-musl/release/aquadoggo \ | ||
/usr/local/bin/ | ||
CMD /usr/local/bin/aquadoggo |
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