From 5c62ee40771c3c8546dd319c827ea6deb8318fc8 Mon Sep 17 00:00:00 2001 From: Mia Winter Date: Thu, 6 Jun 2024 11:13:41 +0200 Subject: [PATCH] updated github action for ghcr.io, alpine image variants --- .github/workflows/docker.yml | 22 ++++++++++++++++------ Wave/Dockerfile | 3 ++- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index f825323..0bbb5d9 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -2,14 +2,14 @@ name: Docker Release on: push: - tags: [ v*, alpha-*, beta-* ] - -env: - IMAGE_NAME: miawinter/wave + tags: [ v* ] jobs: build: runs-on: ubuntu-latest + strategy: + matrix: + image_suffix: ["", "-alpine"] steps: - name: Checkout @@ -19,11 +19,14 @@ jobs: id: meta uses: docker/metadata-action@v5 with: - images: ${{ env.IMAGE_NAME }} + images: | + miawinter/wave + ghcr.io/${{ github.repository }} tags: | type=semver,pattern={{version}} flavor: | latest=true + suffix=${{ matrix.suffix }}, onlatest=true labels: | maintainer=Mia Rose Winter org.opencontainers.image.title=Wave @@ -32,8 +35,14 @@ jobs: org.opencontainers.image.description=The Collaborative Open Source Blogging Engine org.opencontainers.image.vendor=Winter Software org.opencontainers.image.licenses=MIT - + - name: Log into the Container registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Log into Docker Hub uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} @@ -52,3 +61,4 @@ jobs: labels: ${{ steps.meta.outputs.labels }} build-args: | VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }} + BASE=8.0${{ matrix.suffix }} diff --git a/Wave/Dockerfile b/Wave/Dockerfile index 4f2e11b..7a03e28 100644 --- a/Wave/Dockerfile +++ b/Wave/Dockerfile @@ -1,6 +1,7 @@ #See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging. -FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base +ARG BASE=8.0 +FROM mcr.microsoft.com/dotnet/aspnet:$BASE AS base RUN mkdir -p /app/files && chown app /app/files RUN mkdir -p /configuration && chown app /configuration RUN apt-get update && apt-get install -y curl