From 8737f064a3077536d7ce350566aa9d9947acb350 Mon Sep 17 00:00:00 2001 From: Kara <49822414+karashiiro@users.noreply.github.com> Date: Mon, 5 Sep 2022 16:55:49 -0700 Subject: [PATCH] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 34 +++++++++++++++++----------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 8a38d28..403892c 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -6,15 +6,15 @@ name: Docker Publish # documentation. on: - release: - types: - - created + push: + branches: + - 'main' + tags: + - 'v*' env: # Use docker.io for Docker Hub if empty REGISTRY: ghcr.io - # github.repository as / - IMAGE_NAME: ${{ github.repository }} jobs: @@ -42,25 +42,33 @@ jobs: # Extract metadata (tags, labels) for Docker # https://github.com/docker/metadata-action - name: Extract Docker metadata - id: meta + id: meta_server uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + images: ${{ env.REGISTRY }}/plugin-platform-server # Build and push Docker image with Buildx (don't push on PR) # https://github.com/docker/build-push-action - name: Build and push Docker image uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc with: - context: ./server + context: '{{defaultContext}}:server' push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} + tags: ${{ steps.meta_server.outputs.tags }} + labels: ${{ steps.meta_server.outputs.labels }} + + # Extract metadata (tags, labels) for Docker + # https://github.com/docker/metadata-action + - name: Extract Docker metadata + id: meta_client + uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 + with: + images: ${{ env.REGISTRY }}/plugin-platform-client - name: Build and push Docker image uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc with: - context: ./client + context: '{{defaultContext}}:client' push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} + tags: ${{ steps.meta_client.outputs.tags }} + labels: ${{ steps.meta_client.outputs.labels }}