You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ozone.apache.org by ad...@apache.org on 2024/11/03 06:59:20 UTC

(ozone-docker-runner) branch test-HDDS-8569 created (now e739384)

This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a change to branch test-HDDS-8569
in repository https://gitbox.apache.org/repos/asf/ozone-docker-runner.git


      at e739384  disable push

This branch includes the following new commits:

     new b6dd608  HDDS-11632. Publish images to GitHub container repo
     new e739384  disable push

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@ozone.apache.org
For additional commands, e-mail: commits-help@ozone.apache.org


(ozone-docker-runner) 01/02: HDDS-11632. Publish images to GitHub container repo

Posted by ad...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch test-HDDS-8569
in repository https://gitbox.apache.org/repos/asf/ozone-docker-runner.git

commit b6dd608728663904cfd74c921e442ea2fcfcb573
Author: Doroszlai, Attila <ad...@apache.org>
AuthorDate: Thu Oct 31 17:56:02 2024 +0100

    HDDS-11632. Publish images to GitHub container repo
---
 .github/workflows/build.yaml | 77 ++++++++++++++++++++++++++++++++++++++++----
 1 file changed, 71 insertions(+), 6 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index de51b61..9fe38b1 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -14,14 +14,79 @@
 # limitations under the License.
 name: build
 on:
-  - push
-  - pull_request
+  pull_request:
+    types: [opened, ready_for_review, synchronize]
+  push:
+env:
+  VERSION: ${{ github.sha }}
 jobs:
   build:
     name: build and deploy
     runs-on: ubuntu-latest
+    permissions:
+      contents: read
+      packages: write
     steps:
-      - name: checkout source
-        uses: actions/checkout@v4
-      - name: build image
-        run: DOCKER_BUILDKIT=1 docker build -t ghcr.io/$(echo $GITHUB_REPOSITORY | tr '[:upper:]' '[:lower:]' | sed 's/docker-//g') .
+      - name: Calculate image name in owner/repo format
+        id: names
+        run: |
+          owner="$(echo ${{ github.repository_owner }} | tr '[A-Z]' '[a-z]')"
+          echo "image_id=$owner/$IMAGE_NAME" >> $GITHUB_OUTPUT
+
+      - name: Docker meta
+        id: meta
+        uses: docker/metadata-action@v5
+        with:
+          images: |
+            ghcr.io/${{ github.repository_owner }}/ozone-runner
+          tags: |
+            type=ref,event=tag
+            type=sha,prefix=,format=long
+
+      - name: Check if image exists
+        id: pull
+        run: |
+          success=false
+          if docker pull "ghcr.io/$IMAGE_ID:$VERSION"; then
+            success=true
+          fi
+          echo "success=$success" >> $GITHUB_OUTPUT
+        env:
+          IMAGE_ID: ${{ steps.names.outputs.image_id }}
+        continue-on-error: true
+
+      - name: Set up QEMU
+        if: ${{ steps.pull.outputs.success != 'true' }}
+        uses: docker/setup-qemu-action@v3
+
+      - name: Set up Docker Buildx
+        if: ${{ steps.pull.outputs.success != 'true' }}
+        uses: docker/setup-buildx-action@v3
+
+      - name: Login to ghcr.io
+        if: ${{ github.event_name == 'push' }}
+        run: |
+          echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
+
+      - name: Build and push multi-platform image
+        if: ${{ steps.pull.outputs.success != 'true' }}
+        uses: docker/build-push-action@v6
+        with:
+          platforms: linux/amd64,linux/arm64
+          push: ${{ github.event_name == 'push' }}
+          tags: ${{ steps.meta.outputs.tags }}
+          labels: ${{ steps.meta.outputs.labels }}
+
+      - name: Apply tag to existing image
+        if: ${{ github.event_name == 'push' && github.ref_type == 'tag' && steps.pull.outputs.success == 'true' }}
+        run: |
+          docker tag "ghcr.io/$IMAGE_ID:$VERSION" "ghcr.io/$IMAGE_ID:$TAG"
+          docker push "ghcr.io/$IMAGE_ID:$TAG"
+        env:
+          IMAGE_ID: ${{ steps.names.outputs.image_id }}
+          TAG: ${{ github.ref_name }}
+
+      - name: Logout
+        if: always()
+        run: |
+          docker logout


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@ozone.apache.org
For additional commands, e-mail: commits-help@ozone.apache.org


(ozone-docker-runner) 02/02: disable push

Posted by ad...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch test-HDDS-8569
in repository https://gitbox.apache.org/repos/asf/ozone-docker-runner.git

commit e739384daf640777320df1ee952aa37759179757
Author: Doroszlai, Attila <ad...@apache.org>
AuthorDate: Sun Nov 3 07:58:38 2024 +0100

    disable push
---
 .github/workflows/build.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 9fe38b1..c38cb76 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -73,7 +73,7 @@ jobs:
         uses: docker/build-push-action@v6
         with:
           platforms: linux/amd64,linux/arm64
-          push: ${{ github.event_name == 'push' }}
+          push: false
           tags: ${{ steps.meta.outputs.tags }}
           labels: ${{ steps.meta.outputs.labels }}
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@ozone.apache.org
For additional commands, e-mail: commits-help@ozone.apache.org