From 40ee15d98a38e37fcde0a704ea380f71a161e8e3 Mon Sep 17 00:00:00 2001 From: Milkshak3s Date: Sun, 26 Feb 2023 13:39:33 -0800 Subject: [PATCH 1/2] Build dev images on push --- .github/workflows/publish_image_on_push.yml | 60 +++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 .github/workflows/publish_image_on_push.yml diff --git a/.github/workflows/publish_image_on_push.yml b/.github/workflows/publish_image_on_push.yml new file mode 100644 index 00000000000..cea01d5b320 --- /dev/null +++ b/.github/workflows/publish_image_on_push.yml @@ -0,0 +1,60 @@ +# 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: Publish Docker image + +on: + push: + branches: ['dev'] + +env: + REGISTRY: ghcr.io/persistentss13 + IMAGE_NAME: nebula + IMAGE_NAME_SQL: nebula-sql + +jobs: + build-and-push-image-dev: + 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 }} + tags: + type=ref,event=push + type=sha,format=long + + - 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 }} + + - name: Extract metadata (tags, labels) for SQL + id: meta-2 + uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_SQL }} From 090b4dda1a0649197236ff537ce8a670fb938e19 Mon Sep 17 00:00:00 2001 From: Milkshak3s Date: Sun, 26 Feb 2023 13:59:02 -0800 Subject: [PATCH 2/2] Include sql image --- .github/workflows/publish_image_on_push.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/publish_image_on_push.yml b/.github/workflows/publish_image_on_push.yml index cea01d5b320..ba0de7dfea9 100644 --- a/.github/workflows/publish_image_on_push.yml +++ b/.github/workflows/publish_image_on_push.yml @@ -58,3 +58,14 @@ jobs: uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_SQL }} + tags: + type=ref,event=push + type=sha,format=long + + - name: Build and push Docker image + uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc + with: + context: . + push: true + tags: ${{ steps.meta-2.outputs.tags }} + labels: ${{ steps.meta-2.outputs.labels }}