2024-10-30 05:03:44 +00:00
|
|
|
name: Create postgresql docker image
|
2024-09-17 12:39:56 +00:00
|
|
|
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- devel
|
|
|
|
paths:
|
2024-10-30 05:03:44 +00:00
|
|
|
- "Dockerfile"
|
2024-09-17 12:39:56 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
Explore-Gitea-Actions:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
2024-10-30 05:03:44 +00:00
|
|
|
REGISTRY: git.cooltux.net
|
|
|
|
REGISTRY_INTERN: registry.tuxnet.lan
|
2024-09-17 12:39:56 +00:00
|
|
|
IMAGE: web/dokuwiki
|
2024-10-30 05:03:44 +00:00
|
|
|
DOCKER_ORG: ${{ secrets.DOCKER_USERNAME }}
|
2024-09-17 12:39:56 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Set up QEMU
|
|
|
|
uses: docker/setup-qemu-action@v2
|
|
|
|
|
|
|
|
- name: Set up Docker BuildX
|
|
|
|
uses: docker/setup-buildx-action@v2
|
|
|
|
with: # replace it with your local IP
|
|
|
|
config-inline: |
|
2024-10-30 05:03:44 +00:00
|
|
|
[registry."git.cooltux.net"]
|
|
|
|
http = false
|
|
|
|
insecure = false
|
2024-09-17 12:39:56 +00:00
|
|
|
[registry."registry.tuxnet.lan"]
|
|
|
|
http = true
|
2024-10-30 05:03:44 +00:00
|
|
|
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
|
2024-09-17 12:39:56 +00:00
|
|
|
|
|
|
|
- name: Set Docker Version
|
|
|
|
id: get_version
|
|
|
|
run: |
|
|
|
|
DOCKER_VERSION=$(grep -oP '(?<=org.opencontainers.image.ref.name=").*\d' Dockerfile)
|
|
|
|
echo "Docker version: $DOCKER_VERSION"
|
2024-10-30 05:03:44 +00:00
|
|
|
echo "::set-output name=tag::$DOCKER_VERSION"
|
2024-09-17 12:39:56 +00:00
|
|
|
|
|
|
|
- name: Build and push
|
|
|
|
uses: docker/build-push-action@v4
|
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
file: ./Dockerfile
|
|
|
|
platforms: |
|
2024-10-30 05:03:44 +00:00
|
|
|
linux/amd64
|
|
|
|
push: false
|
|
|
|
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 }}
|