From 9f5bce0483b03d2b8e187c3351ce029107a1f217 Mon Sep 17 00:00:00 2001 From: VoidChaosCreate <39486650+VoidChaosCreate@users.noreply.github.com> Date: Fri, 17 Feb 2023 02:12:34 +0530 Subject: [PATCH 1/5] Create main.yml --- .github/workflows/main.yml | 50 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..fb4ed05 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,50 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +# GitHub recommends pinning actions to a commit SHA. +# To get a newer version, you will need to update the SHA. +# You can also reference a tag or branch, but the action may change without warning. + +name: Create and publish a Docker image + +on: + push: + branches: ['release'] + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + build-and-push-image: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Log in to the Container registry + uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: Build and push Docker image + uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} From 10f76668f68f61fc1d681ac58b34f57262f10b7b Mon Sep 17 00:00:00 2001 From: VoidChaosCreate <39486650+VoidChaosCreate@users.noreply.github.com> Date: Fri, 17 Feb 2023 02:14:17 +0530 Subject: [PATCH 2/5] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fb4ed05..91f2a97 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,7 +11,7 @@ name: Create and publish a Docker image on: push: - branches: ['release'] + branches: [ "main" ] env: REGISTRY: ghcr.io From 1c8ab5f7a248ef9c7c97174ba5874a83681dc426 Mon Sep 17 00:00:00 2001 From: VoidChaosCreate <39486650+VoidChaosCreate@users.noreply.github.com> Date: Fri, 17 Feb 2023 09:37:17 +0530 Subject: [PATCH 3/5] Update and rename main.yml to Docker-image-to-package.yml --- .../{main.yml => Docker-image-to-package.yml} | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) rename .github/workflows/{main.yml => Docker-image-to-package.yml} (71%) diff --git a/.github/workflows/main.yml b/.github/workflows/Docker-image-to-package.yml similarity index 71% rename from .github/workflows/main.yml rename to .github/workflows/Docker-image-to-package.yml index 91f2a97..48dbc0d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/Docker-image-to-package.yml @@ -1,17 +1,10 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - -# GitHub recommends pinning actions to a commit SHA. -# To get a newer version, you will need to update the SHA. -# You can also reference a tag or branch, but the action may change without warning. - -name: Create and publish a Docker image +name: Create and publish a Docker image to ghcr.io on: push: branches: [ "main" ] + pull_request: + branches: [ "main" ] env: REGISTRY: ghcr.io From a31ee330a568ff1b02a39cc5aca8deee776aead2 Mon Sep 17 00:00:00 2001 From: VoidChaosCreate <39486650+VoidChaosCreate@users.noreply.github.com> Date: Sun, 19 Feb 2023 02:48:29 +0530 Subject: [PATCH 4/5] Update Docker-image-to-package.yml --- .github/workflows/Docker-image-to-package.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/Docker-image-to-package.yml b/.github/workflows/Docker-image-to-package.yml index 48dbc0d..29c0098 100644 --- a/.github/workflows/Docker-image-to-package.yml +++ b/.github/workflows/Docker-image-to-package.yml @@ -22,7 +22,7 @@ jobs: uses: actions/checkout@v3 - name: Log in to the Container registry - uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 + uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} @@ -30,12 +30,12 @@ jobs: - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 + uses: docker/metadata-action@v3 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - name: Build and push Docker image - uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc + uses: docker/build-push-action@v3 with: context: . push: true From 1c7cc8f730eee4f0b0b153fe21414540fb1e24b0 Mon Sep 17 00:00:00 2001 From: VoidChaosCreate <39486650+VoidChaosCreate@users.noreply.github.com> Date: Sun, 19 Feb 2023 02:58:25 +0530 Subject: [PATCH 5/5] Update Docker-image-to-package.yml --- .github/workflows/Docker-image-to-package.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/Docker-image-to-package.yml b/.github/workflows/Docker-image-to-package.yml index 29c0098..0e63063 100644 --- a/.github/workflows/Docker-image-to-package.yml +++ b/.github/workflows/Docker-image-to-package.yml @@ -22,7 +22,7 @@ jobs: uses: actions/checkout@v3 - name: Log in to the Container registry - uses: docker/login-action@v3 + uses: docker/login-action@v2 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} @@ -30,12 +30,12 @@ jobs: - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@v3 + uses: docker/metadata-action@v2 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - name: Build and push Docker image - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v2 with: context: . push: true