This repository has been archived by the owner on Jun 10, 2024. It is now read-only.
Bump @types/react from 18.0.37 to 18.2.22 #1216
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
# SPDX-License-Identifier: Apache-2.0 | |
# # Copyright Contributors to the ODPi Egeria project. | |
# | |
name: Egeria UI Build | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v3.1.0 | |
- name: Check if version has been updated | |
id: check | |
uses: EndBug/version-check@v1 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3.5.1 | |
with: | |
node-version: "16.13.0" | |
- name: Report npm and node version | |
run: | | |
node -v | |
npm -v | |
- name: Install Dependencies | |
run: npm install | |
- name: Lint | |
run: npm run lint | |
- name: Test | |
run: npm run test | |
- name: Build | |
run: npm run build | |
env: | |
NODE_OPTIONS: "--max_old_space_size=6144" | |
# Get package version from the package.json | |
- name: get-npm-version | |
id: package-version | |
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 }} | |
- 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: ${{ 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 main merge) | |
id: docker_build_release | |
uses: docker/build-push-action@v2 | |
if: ${{ steps.check.outputs.changed == 'true' && github.ref != 'refs/heads/main' }} | |
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 | |
platforms: linux/amd64, linux/arm64 | |
# For main code stream we push the image and add the latest tag | |
- name: Build and push (main merge) | |
id: docker_build_main | |
uses: docker/build-push-action@v2 | |
if: ${{ steps.check.outputs.changed == 'true' && github.ref == 'refs/heads/main' }} | |
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 | |
platforms: linux/amd64, linux/arm64 | |
# Note the digest | |
- name: Image digest (release) | |
if: ${{ steps.check.outputs.changed == 'true' && github.ref != 'refs/heads/main' }} | |
run: echo ${{ steps.docker_build_release.outputs.digest }} | |
- name: Image digest (main) | |
if: ${{ steps.check.outputs.changed == 'true' && github.ref == 'refs/heads/main' }} | |
run: echo ${{ steps.docker_build_main.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 |