ci-action for container_build
This commit is contained in:
52
.gitea/workflows/create_and_push_multiarch_container.yml
Normal file
52
.gitea/workflows/create_and_push_multiarch_container.yml
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
name: release-tag
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch: # Manuelles Auslösen des Workflows
|
||||||
|
inputs:
|
||||||
|
image_tag:
|
||||||
|
description: 'Tag für das Docker-Image (z.B. latest oder v1.0.0)'
|
||||||
|
required: true
|
||||||
|
default: 'latest'
|
||||||
|
|
||||||
|
env:
|
||||||
|
image_name: 404_games
|
||||||
|
registry: gitea.tebarius.duckdns.org
|
||||||
|
user: tebarius
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release-image:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v2
|
||||||
|
|
||||||
|
- name: Login to Gitea
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
registry: ${{ env.registry }}
|
||||||
|
username: ${{ env.user }}
|
||||||
|
password: ${{ secrets.DOCKER_TOKEN }}
|
||||||
|
|
||||||
|
- name: Get Meta
|
||||||
|
id: meta
|
||||||
|
run: |
|
||||||
|
echo REPO_VERSION=$(git describe --tags --always | sed 's/^v//') >> $GITHUB_OUTPUT
|
||||||
|
echo DOCKERFILE_VERSION=$(grep 'LABEL version=' Dockerfile | sed 's/.*LABEL version="\([^"]*\)".*/\1/') >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Build and push
|
||||||
|
run: |
|
||||||
|
# Stelle sicher, dass Buildx aktiviert ist
|
||||||
|
docker buildx create --use
|
||||||
|
|
||||||
|
# Führe den Multiarch-Build aus und pushe das Image
|
||||||
|
docker buildx build \
|
||||||
|
--file ./Dockerfile \
|
||||||
|
--platform linux/amd64,linux/386,linux/arm64,linux/arm/v7 \
|
||||||
|
--tag ${{ env.registry }}/${{ env.user }}/${{ env.image_name }}:${{ steps.meta.outputs.REPO_VERSION }} \
|
||||||
|
--tag ${{ env.registry }}/${{ env.user }}/${{ env.image_name }}:${{ steps.meta.outputs.DOCKERFILE_VERSION }} \
|
||||||
|
--tag ${{ env.registry }}/${{ env.user }}/${{ env.image_name }}:${{ github.event.inputs.image_tag }} \
|
||||||
|
--push ./
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
FROM nginx:stable-alpine-slim
|
FROM nginx:stable-alpine-slim
|
||||||
LABEL authors="tebarius"
|
LABEL authors="tebarius"
|
||||||
|
LABEL version="1.0.0"
|
||||||
LABEL description="nginx_with_404_and_502_games"
|
LABEL description="nginx_with_404_and_502_games"
|
||||||
|
|
||||||
COPY ./games /usr/share/nginx/html
|
COPY ./games /usr/share/nginx/html
|
||||||
|
|||||||
Reference in New Issue
Block a user