diff --git a/.github/workflows/node-build.yml b/.github/workflows/node-build.yml index 737d36a9..6742aac7 100644 --- a/.github/workflows/node-build.yml +++ b/.github/workflows/node-build.yml @@ -16,6 +16,9 @@ jobs: steps: - name: Checkout source uses: actions/checkout@v2 + - name: Check if version has been updated + id: check + uses: EndBug/version-check@v1 - name: Setup Node.js uses: actions/setup-node@v2.1.5 with: @@ -41,24 +44,25 @@ jobs: uses: martinbeentjes/npm-get-version-action@master - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 + if: ${{ steps.check.outputs.changed == 'true' }} - name: Login to DockerHub uses: docker/login-action@v1 + if: ${{ steps.check.outputs.changed == 'true' && github.event_name == 'push' && github.repository == 'odpi/egeria-ui' }} with: username: ${{ secrets.DOCKER_HUB_USERNAME }} password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} - if: ${{ github.event_name == 'push' && github.repository == 'odpi/egeria-ui' }} - name: Login to container registry (Quay.io) uses: docker/login-action@v1 with: registry: quay.io username: ${{ secrets.QUAY_IO_USERNAME }} password: ${{ secrets.QUAY_IO_ACCESS_TOKEN }} - if: ${{ github.event_name == 'push' && github.repository == 'odpi/egeria-ui' }} + if: ${{ steps.check.outputs.changed == 'true' && github.event_name == 'push' && github.repository == 'odpi/egeria-ui' }} # For releases (ie not main) we push the image - but not the latest tag - name: Build and push (not master merge) - if: github.ref != 'refs/heads/master' id: docker_build_release uses: docker/build-push-action@v2 + if: ${{ steps.check.outputs.changed == 'true' && github.ref != 'refs/heads/master' }} with: push: ${{ github.event_name == 'push' && github.repository == 'odpi/egeria-ui' }} tags: odpi/egeria-ui:${{ steps.package-version.outputs.current-version}}, quay.io/odpi/egeria-ui:${{ steps.package-version.outputs.current-version}} @@ -66,9 +70,9 @@ jobs: file: ./Dockerfile # For main code stream we push the image and add the latest tag - name: Build and push (master merge) - if: github.ref == 'refs/heads/master' id: docker_build_master uses: docker/build-push-action@v2 + if: ${{ steps.check.outputs.changed == 'true' && github.ref == 'refs/heads/master' }} with: push: ${{ github.event_name == 'push' && github.repository == 'odpi/egeria-ui' }} tags: odpi/egeria-ui:${{ steps.package-version.outputs.current-version }}, odpi/egeria-ui:latest, quay.io/odpi/egeria-ui:${{ steps.package-version.outputs.current-version }}, quay.io/odpi/egeria-ui:latest @@ -76,16 +80,18 @@ jobs: file: ./Dockerfile # Note the digest - name: Image digest (release) - if: github.ref != 'refs/heads/master' + if: ${{ steps.check.outputs.changed == 'true' && github.ref != 'refs/heads/master' }} run: echo ${{ steps.docker_build_release.outputs.digest }} - name: Image digest (master) - if: github.ref == 'refs/heads/master' + if: ${{ steps.check.outputs.changed == 'true' && github.ref == 'refs/heads/master' }} run: echo ${{ steps.docker_build_master.outputs.digest }} # Save an artifact of the build tree & upload - name: Create Archive + if: ${{ steps.check.outputs.changed == 'true' }} run: tar -zcf /tmp/egeria-ui.tar.gz . - name: Upload uses: actions/upload-artifact@v2 + if: ${{ steps.check.outputs.changed == 'true' }} with: name: Egeria UI ${{ steps.package-version.outputs.current-version }} path: /tmp/egeria-ui.tar.gz diff --git a/package-lock.json b/package-lock.json index 0690e132..13f73305 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "egeria-ui", - "version": "3.1.0", + "version": "3.1.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index d0475dc1..23bf090a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "egeria-ui", - "version": "3.1.0", + "version": "3.1.1", "description": "Egeria UI application", "author": "Egeria contributors", "license": "Apache-2.0",