From 78bca55e6c21f530b36341b7d4edfffc7dd801de Mon Sep 17 00:00:00 2001 From: Florian RICHER Date: Fri, 11 Oct 2024 22:27:04 +0200 Subject: [PATCH] Try docker only --- .gitea/workflows/build.yml | 47 +++++++------------------------------- 1 file changed, 8 insertions(+), 39 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 9af7b2a..927fb99 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -29,9 +29,6 @@ jobs: id-token: write steps: - - name: Install buildah - run: apt update && apt install -y buildah - - name: Checkout uses: https://github.com/actions/checkout@v3 @@ -88,29 +85,6 @@ jobs: org.opencontainers.image.description=${{ env.MY_IMAGE_DESC }} org.opencontainers.image.title=${{ env.MY_IMAGE_NAME }} - # Build image using Buildah action - - name: Build Image - id: build_image - uses: https://github.com/redhat-actions/buildah-build@v2 - with: - containerfiles: | - ./Containerfile - # Postfix image name with -custom to make it a little more descriptive - # Syntax: https://docs.github.com/en/actions/learn-github-actions/expressions#format - image: ${{ env.MY_IMAGE_NAME }} - tags: | - ${{ steps.generate-tags.outputs.alias_tags }} - labels: ${{ steps.meta.outputs.labels }} - oci: false - - # Workaround bug where capital letters in your GitHub username make it impossible to push to GHCR. - # https://github.com/macbre/push-to-ghcr/issues/12 - - name: Lowercase Registry - id: registry_case - uses: https://github.com/ASzc/change-string-case-action@v6 - with: - string: ${{ env.IMAGE_REGISTRY }} - - name: Login to GitHub Container Registry uses: https://github.com/docker/login-action@v3 with: @@ -118,20 +92,15 @@ jobs: username: ${{ secrets.USERNAME }} password: ${{ secrets.PASSWORD }} - - name: Push Image to GHCR - uses: https://github.com/redhat-actions/push-to-registry@v2 - id: push - env: - REGISTRY_USER: ${{ secrets.USERNAME }} - REGISTRY_PASSWORD: ${{ secrets.PASSWORD }} + # Build and push image using Docker Build and Push action + - name: Build and Push Image + uses: https://github.com/docker/build-push-action@v5 with: - image: ${{ steps.build_image.outputs.image }} - tags: ${{ steps.build_image.outputs.tags }} - registry: ${{ steps.registry_case.outputs.lowercase }} - username: ${{ env.REGISTRY_USER }} - password: ${{ env.REGISTRY_PASSWORD }} - extra-args: | - --disable-content-trust + context: . + file: ./Containerfile + push: true + tags: ${{ steps.generate-tags.outputs.alias_tags }} + labels: ${{ steps.meta.outputs.labels }} # This section is optional and only needs to be enabled if you plan on distributing # your project for others to consume. You will need to create a public and private key