Make simple docker containers from the build artefact
Some checks failed
Rust CI / Build and Test (push) Failing after 10m16s
Some checks failed
Rust CI / Build and Test (push) Failing after 10m16s
This commit is contained in:
parent
76df9e46f3
commit
ff31e6ab8f
21
.github/workflows/build.yml
vendored
21
.github/workflows/build.yml
vendored
@ -70,6 +70,27 @@ jobs:
|
|||||||
target/release/${{ github.event.repository.name }}
|
target/release/${{ github.event.repository.name }}
|
||||||
target/aarch64-unknown-linux-gnu/release/${{ github.event.repository.name }}
|
target/aarch64-unknown-linux-gnu/release/${{ github.event.repository.name }}
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v2
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
|
- name: Login to DockerHub
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build and push multi-arch Docker image
|
||||||
|
uses: docker/build-push-action@v4
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ./Dockerfile
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
push: true
|
||||||
|
tags: git.joshuacoles.me/${{ github.repository }}:latest,git.joshuacoles.me/${{ github.repository }}:${{ github.sha }}
|
||||||
|
|
||||||
- uses: robiningelbrecht/ntfy-action@v1.0.0
|
- uses: robiningelbrecht/ntfy-action@v1.0.0
|
||||||
name: Notify via ntfy.sh
|
name: Notify via ntfy.sh
|
||||||
if: always()
|
if: always()
|
||||||
|
|||||||
14
Dockerfile
Normal file
14
Dockerfile
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
FROM --platform=$BUILDPLATFORM debian:buster-slim AS builder
|
||||||
|
ARG TARGETPLATFORM
|
||||||
|
WORKDIR /app
|
||||||
|
COPY . .
|
||||||
|
RUN case "$TARGETPLATFORM" in \
|
||||||
|
"linux/amd64") BINARY_PATH="target/release/toggl-bridge" ;; \
|
||||||
|
"linux/arm64") BINARY_PATH="target/aarch64-unknown-linux-gnu/release/toggl-bridge" ;; \
|
||||||
|
*) exit 1 ;; \
|
||||||
|
esac && \
|
||||||
|
mv "$BINARY_PATH" /usr/local/bin/toggl-bridge
|
||||||
|
|
||||||
|
FROM --platform=$TARGETPLATFORM debian:buster-slim
|
||||||
|
COPY --from=builder /usr/local/bin/toggl-bridge /usr/local/bin/
|
||||||
|
CMD ["toggl-bridge"]
|
||||||
Loading…
Reference in New Issue
Block a user