.gitea/workflows/build.yml aktualisiert

This commit is contained in:
Marko Oldenburg 2024-10-30 05:02:12 +00:00
parent 11cafede48
commit aa3896f638

View File

@ -1,18 +1,20 @@
name: Create dokuwiki docker image name: Create postgresql docker image
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀 run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
on: on:
push: push:
branches: branches:
- main - main
paths: paths:
- '*Dockerfile' - "Dockerfile"
jobs: jobs:
Explore-Gitea-Actions: Explore-Gitea-Actions:
runs-on: ubuntu-latest runs-on: ubuntu-latest
env: env:
REGISTRY: registry.tuxnet.lan REGISTRY: git.cooltux.net
REGISTRY_INTERN: registry.tuxnet.lan
IMAGE: web/dokuwiki IMAGE: web/dokuwiki
DOCKER_ORG: ${{ secrets.DOCKER_USERNAME }}
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v3
@ -24,16 +26,31 @@ jobs:
uses: docker/setup-buildx-action@v2 uses: docker/setup-buildx-action@v2
with: # replace it with your local IP with: # replace it with your local IP
config-inline: | config-inline: |
[registry."git.cooltux.net"]
http = false
insecure = false
[registry."registry.tuxnet.lan"] [registry."registry.tuxnet.lan"]
http = true http = true
insecure = true insecure = true
- name: Login to DockerHub
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }} # replace it with your local IP
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Get Meta
id: meta
run: |
echo REPO_NAME=$(echo ${GITHUB_REPOSITORY} | awk -F"/" '{print $2}') >> $GITHUB_OUTPUT
- name: Set Docker Version - name: Set Docker Version
id: get_version id: get_version
run: | run: |
DOCKER_VERSION=$(grep -oP '(?<=org.opencontainers.image.ref.name=").*\d' Dockerfile) DOCKER_VERSION=$(grep -oP '(?<=org.opencontainers.image.ref.name=").*\d' Dockerfile)
echo "Docker version: $DOCKER_VERSION" echo "Docker version: $DOCKER_VERSION"
echo "::set-output name=tag::$DOCKER_VERSION" echo "::set-output name=tag::$DOCKER_VERSION"
- name: Build and push - name: Build and push
uses: docker/build-push-action@v4 uses: docker/build-push-action@v4
@ -41,6 +58,8 @@ jobs:
context: . context: .
file: ./Dockerfile file: ./Dockerfile
platforms: | platforms: |
linux/amd64 linux/amd64
push: true push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE }}:${{ steps.get_version.outputs.tag }} tags: |
${{ env.REGISTRY }}/${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }}:${{ steps.get_version.outputs.tag }}
${{ env.REGISTRY_INTERN }}/${{ env.IMAGE }}:${{ steps.get_version.outputs.tag }}