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: on:
push: push:
tags: [ v*, alpha-*, beta-* ] tags: [ v* ]
env:
IMAGE_NAME: miawinter/wave
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy:
matrix:
image_suffix: ["", "-alpine"]
steps: steps:
- name: Checkout - name: Checkout
@ -19,11 +19,14 @@ jobs:
id: meta id: meta
uses: docker/metadata-action@v5 uses: docker/metadata-action@v5
with: with:
images: ${{ env.IMAGE_NAME }} images: |
miawinter/wave
ghcr.io/${{ github.repository }}
tags: | tags: |
type=semver,pattern={{version}} type=semver,pattern={{version}}
flavor: | flavor: |
latest=true latest=true
suffix=${{ matrix.suffix }}, onlatest=true
labels: | labels: |
maintainer=Mia Rose Winter maintainer=Mia Rose Winter
org.opencontainers.image.title=Wave org.opencontainers.image.title=Wave
@ -34,6 +37,12 @@ jobs:
org.opencontainers.image.licenses=MIT org.opencontainers.image.licenses=MIT
- name: Log into the Container registry - 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 uses: docker/login-action@v3
with: with:
username: ${{ secrets.DOCKERHUB_USERNAME }} username: ${{ secrets.DOCKERHUB_USERNAME }}
@ -52,3 +61,4 @@ jobs:
labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}
build-args: | build-args: |
VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }} 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. #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 /app/files && chown app /app/files
RUN mkdir -p /configuration && chown app /configuration RUN mkdir -p /configuration && chown app /configuration
RUN apt-get update && apt-get install -y curl RUN apt-get update && apt-get install -y curl