This repository has been archived by the owner on Jun 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #261 from sarbull/check-for-package-version-updated
Check for package-version-updated
- Loading branch information
Showing
3 changed files
with
14 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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/[email protected] | ||
with: | ||
|
@@ -41,51 +44,54 @@ 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}} | ||
context: . | ||
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 | ||
context: . | ||
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 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters