This commit is contained in:
Juansecu 2024-05-11 22:25:29 +00:00 committed by GitHub
commit a52e508547
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 40 additions and 2 deletions

38
.github/workflows/push-docker-image.yml vendored Normal file
View File

@ -0,0 +1,38 @@
name: Push Docker Image
on:
release:
types: [published]
jobs:
push-docker-image:
name: Push Docker Image
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
matrix:
platforms:
- linux/amd64
- linux/arm64
steps:
- uses: actions/checkout@v4
- name: Retrieve major version
uses: winterjung/split@v2
id: split
with:
msg: ${{ github.ref_name }}
separator: .
- name: Log in to registry
uses: docker/login-action@v3
with:
password: ${{ secrets.DOCKERHUB_TOKEN }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
- name: Build and push the Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
platforms: ${{ matrix.platforms }}
push: true
tags: ${{ secrets.DOCKERHUB_REPOSITORY }}:${{ github.ref_name }},${{ secrets.DOCKERHUB_REPOSITORY }}:${{ steps.split.outputs._0 }},${{ secrets.DOCKERHUB_REPOSITORY }}:latest

View File

@ -1,5 +1,5 @@
# build # build
FROM debian:latest as build FROM debian:stable-slim as build
WORKDIR /usr/src/app WORKDIR /usr/src/app
@ -17,7 +17,7 @@ COPY Makefile CMakeLists.txt version.h.in ./
RUN make -j8 RUN make -j8
# prod # prod
FROM debian:latest FROM debian:stable-slim
WORKDIR /usr/src/app WORKDIR /usr/src/app