From 8ab7b90b15c20237934f04c3a6586c1a34438ea9 Mon Sep 17 00:00:00 2001 From: Marko Oldenburg Date: Tue, 29 Oct 2024 08:04:00 +0000 Subject: [PATCH] =?UTF-8?q?.gitea/workflows/build=5Fpush=5Fgitea.yml=20hin?= =?UTF-8?q?zugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/build_push_gitea.yml | 60 +++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 .gitea/workflows/build_push_gitea.yml diff --git a/.gitea/workflows/build_push_gitea.yml b/.gitea/workflows/build_push_gitea.yml new file mode 100644 index 0000000..e5618da --- /dev/null +++ b/.gitea/workflows/build_push_gitea.yml @@ -0,0 +1,60 @@ +name: Create postgresql docker image +run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀 +on: + push: + branches: + - main + paths: + - "Dockerfile" + +jobs: + Explore-Gitea-Actions: + runs-on: ubuntu-latest + env: + REGISTRY: git.cooltux.net + IMAGE: web/dokuwiki + DOCKER_ORG: ${{ secrets.DOCKER_USERNAME }} + 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: | + [registry."git.cooltux.net"] + http = false + insecure = false + + - 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 + id: get_version + run: | + DOCKER_VERSION=$(grep -oP '(?<=org.opencontainers.image.ref.name=").*\d' Dockerfile) + echo "Docker version: $DOCKER_VERSION" + echo "::set-output name=tag::$DOCKER_VERSION" + + - name: Build and push + uses: docker/build-push-action@v4 + with: + context: . + file: ./Dockerfile + platforms: | + linux/amd64 + push: true + tags: | + ${{ env.REGISTRY }}/${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }}:${{ steps.get_version.outputs.tag }}