2
0

Merge pull request 'split into two actions, dont always build tranga-base' (!47) from dev into master

Reviewed-on: #47
This commit is contained in:
glax 2023-07-21 00:07:16 +02:00
commit 8c9e3ea6b6
3 changed files with 44 additions and 14 deletions

43
.github/workflows/docker-base.yml vendored Normal file
View File

@ -0,0 +1,43 @@
name: Docker Image CI
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
# https://github.com/docker/setup-qemu-action#usage
- name: Set up QEMU
uses: docker/setup-qemu-action@v2.2.0
# https://github.com/marketplace/actions/docker-setup-buildx
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2.9.1
# https://github.com/docker/login-action#docker-hub
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# https://github.com/docker/build-push-action#multi-platform-image
- name: Build and push base
uses: docker/build-push-action@v4.1.1
with:
context: ./
file: ./Dockerfile-base
#platforms: linux/amd64,linux/arm64,linux/riscv64,linux/ppc64le,linux/s390x,linux/386,linux/mips64le,linux/mips64,linux/arm/v7,linux/arm/v6
platforms: linux/amd64,linux/arm/v7,linux/arm64
pull: true
push: true
tags: |
glax/tranga-base:latest

View File

@ -33,19 +33,6 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }} username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }} password: ${{ secrets.DOCKERHUB_TOKEN }}
# https://github.com/docker/build-push-action#multi-platform-image
- name: Build and push base
uses: docker/build-push-action@v4.1.1
with:
context: ./
file: ./Dockerfile-base
#platforms: linux/amd64,linux/arm64,linux/riscv64,linux/ppc64le,linux/s390x,linux/386,linux/mips64le,linux/mips64,linux/arm/v7,linux/arm/v6
platforms: linux/amd64,linux/arm/v7,linux/arm64
pull: true
push: true
tags: |
glax/tranga-base:latest
# https://github.com/docker/build-push-action#multi-platform-image # https://github.com/docker/build-push-action#multi-platform-image
- name: Build and push API - name: Build and push API
uses: docker/build-push-action@v4.1.1 uses: docker/build-push-action@v4.1.1

View File

@ -3,7 +3,7 @@
FROM mcr.microsoft.com/dotnet/sdk:7.0 as build-env FROM mcr.microsoft.com/dotnet/sdk:7.0 as build-env
WORKDIR /src WORKDIR /src
COPY . /src/ COPY . /src/
RUN dotnet restore API/API.csproj RUN dotnet restore /src/API/API.csproj
RUN dotnet publish -c Release -o /publish RUN dotnet publish -c Release -o /publish
FROM glax/tranga-base:latest as runtime FROM glax/tranga-base:latest as runtime