updated github action for ghcr.io, alpine image variants

This commit is contained in:
Mia Rose Winter 2024-06-06 11:13:41 +02:00
parent b468c44cd2
commit 5c62ee4077
Signed by: miawinter
GPG key ID: 4B6F6A83178F595E
2 changed files with 18 additions and 7 deletions

View file

@ -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 }}

View file

@ -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