Skip to content

Commit

Permalink
Bump github actions + Dockerfile
Browse files Browse the repository at this point in the history
Signed-off-by: sinkingpoint <colin@quirl.co.nz>
  • Loading branch information
sinkingpoint committed Nov 17, 2023
1 parent 9207a46 commit b160e8e
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 11 deletions.
22 changes: 16 additions & 6 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# GitHub recommends pinning actions to a commit SHA.
# To get a newer version, you will need to update the SHA.
# You can also reference a tag or branch, but the action may change without warning.

name: Publish Docker image

on:
Expand All @@ -10,24 +19,25 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Log in to Docker Hub
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: sinkingpoint/prometheus-gravel-gateway
images: my-docker-hub-namespace/my-docker-hub-repository

- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
labels: ${{ steps.meta.outputs.labels }}
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- target: x86_64-apple-darwin
archive: zip
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v4
- name: Compile and release
uses: rust-build/rust-build.action@latest
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Build
run: cargo build --verbose
- name: Run tests
Expand Down
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
FROM ekidd/rust-musl-builder:stable as builder
FROM clux/muslrust:stable as builder

ADD --chown=rust:rust . ./
RUN cargo build --release

FROM alpine:latest as runner
FROM alpine:latest
ARG APP_USER=gravel
RUN addgroup -S $APP_USER && adduser -S -g $APP_USER $APP_USER
COPY --from=builder /home/rust/src/target/x86_64-unknown-linux-musl/release/gravel-gateway /usr/bin/gravel-gateway
COPY --from=builder ./volume/target/x86_64-unknown-linux-musl/release/gravel-gateway /usr/bin/gravel-gateway
RUN chown -R $APP_USER:$APP_USER /usr/bin/gravel-gateway
USER $APP_USER
EXPOSE 4278
Expand Down

0 comments on commit b160e8e

Please sign in to comment.