Skip to content

Commit

Permalink
Add docker release action
Browse files Browse the repository at this point in the history
  • Loading branch information
de-luca committed Nov 24, 2021
1 parent d864ef6 commit 0b7e748
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/docker-img.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build and Push Docker image

on:
push:
tags:
- '*'

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v2

- uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- uses: docker/metadata-action@v3
id: meta
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
name: Release

on:
push:
tags:
- '*'

jobs:
release:
runs-on: ubuntu-latest
Expand Down
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM ekidd/rust-musl-builder as builder
ADD --chown=rust:rust ./ /home/rust/src
RUN cargo build --release

# FROM alpine:latest as certs
# RUN apk add --no-cache ca-certificates

FROM scratch
ENV RUST_LOG=info
# COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=builder /home/rust/src/target/x86_64-unknown-linux-musl/release/beacon /bin/beacon
EXPOSE 7878
ENTRYPOINT [ "/bin/beacon" ]

0 comments on commit 0b7e748

Please sign in to comment.