From ac949a31c3d88e6b4990d6ecd0ad67ba491c0c3e Mon Sep 17 00:00:00 2001 From: Philipp Wundrack Date: Tue, 21 Mar 2023 10:37:59 +0100 Subject: [PATCH 01/12] replace docker hub with the GitHub registry --- .github/workflows/docker_image.yml | 40 +++++++++++++++++++++++++++ .github/workflows/dockerhub.yml | 44 ------------------------------ 2 files changed, 40 insertions(+), 44 deletions(-) create mode 100644 .github/workflows/docker_image.yml delete mode 100644 .github/workflows/dockerhub.yml diff --git a/.github/workflows/docker_image.yml b/.github/workflows/docker_image.yml new file mode 100644 index 0000000..6d50ab7 --- /dev/null +++ b/.github/workflows/docker_image.yml @@ -0,0 +1,40 @@ +name: Push docker images to the GitHub registry + +on: + push: + branches: master + tags: + - "v*.*.*" + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + multi: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v3 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Login to DockerHub + uses: docker/login-action@v2 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push version of OpenTOSCA UI + uses: docker/build-push-action@v4 + with: + context: . + platforms: linux/amd64,linux/arm64 + push: true + tags: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/dockerhub.yml b/.github/workflows/dockerhub.yml deleted file mode 100644 index 25bedc6..0000000 --- a/.github/workflows/dockerhub.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Push docker images to Dockerhub - -on: - push: - branches: master - tags: - - "v*.*.*" - -jobs: - multi: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - name: Set output - id: vars - run: echo ::set-output name=tag::${GITHUB_REF#refs/*/} - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - name: Login to DockerHub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_ACCESS_TOKEN }} - - - name: Build and push latest OpenTOSCA UI - if: ${{ steps.vars.outputs.tag == 'master' }} - uses: docker/build-push-action@v2 - with: - context: . - platforms: linux/amd64,linux/arm64 - push: true - tags: opentosca/ui:latest - - - name: Build and push version of OpenTOSCA UI - if: ${{ steps.vars.outputs.tag != 'master' }} - uses: docker/build-push-action@v2 - with: - context: . - platforms: linux/amd64,linux/arm64 - push: true - tags: opentosca/ui:${{ steps.vars.outputs.tag }} From f7c183cd04e72b34426c76631bfa188df6348a33 Mon Sep 17 00:00:00 2001 From: Philipp Wundrack Date: Tue, 21 Mar 2023 10:42:40 +0100 Subject: [PATCH 02/12] fix image tags --- .github/workflows/docker_image.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker_image.yml b/.github/workflows/docker_image.yml index 6d50ab7..977c633 100644 --- a/.github/workflows/docker_image.yml +++ b/.github/workflows/docker_image.yml @@ -37,4 +37,5 @@ jobs: context: . platforms: linux/amd64,linux/arm64 push: true - tags: ${{ steps.meta.outputs.labels }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} From 2ba1a61b90e4e0226c4d6cfd40fdd9d39908f4fb Mon Sep 17 00:00:00 2001 From: Philipp Wundrack Date: Tue, 21 Mar 2023 11:26:24 +0100 Subject: [PATCH 03/12] improve name --- .github/workflows/docker_image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker_image.yml b/.github/workflows/docker_image.yml index 977c633..5bf704e 100644 --- a/.github/workflows/docker_image.yml +++ b/.github/workflows/docker_image.yml @@ -31,7 +31,7 @@ jobs: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and push version of OpenTOSCA UI + - name: Build and push uses: docker/build-push-action@v4 with: context: . From 06ea34d9b411291b5bacb6f949989c06a8f526a5 Mon Sep 17 00:00:00 2001 From: Philipp Wundrack Date: Tue, 21 Mar 2023 12:16:57 +0100 Subject: [PATCH 04/12] fix lint action --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 9310714..6400026 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -19,7 +19,7 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v1 with: - node-version: 17 + node-version: 14 # ESLint and Prettier must be in `package.json` - name: Install Node.js dependencies from package-lock.json From 621908c717760d53cb705427436acf4fd32735a3 Mon Sep 17 00:00:00 2001 From: Philipp Wundrack Date: Tue, 21 Mar 2023 12:17:51 +0100 Subject: [PATCH 05/12] revert fix --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 6400026..9310714 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -19,7 +19,7 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v1 with: - node-version: 14 + node-version: 17 # ESLint and Prettier must be in `package.json` - name: Install Node.js dependencies from package-lock.json From be91da1d8bc2b60864cbb17d43c94cd7f3d969cc Mon Sep 17 00:00:00 2001 From: Philipp Wundrack Date: Tue, 21 Mar 2023 13:42:17 +0100 Subject: [PATCH 06/12] fix lint action --- .github/workflows/lint.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 9310714..18513a4 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -11,16 +11,13 @@ jobs: run-linters: name: Run linters runs-on: ubuntu-latest + container: + image: node:14 steps: - name: Check out Git repository uses: actions/checkout@v2 - - name: Set up Node.js - uses: actions/setup-node@v1 - with: - node-version: 17 - # ESLint and Prettier must be in `package.json` - name: Install Node.js dependencies from package-lock.json run: npm clean-install From 8214e9fc4ddb69fde990e8b2179bfd4eb34b4f04 Mon Sep 17 00:00:00 2001 From: Philipp Wundrack Date: Tue, 21 Mar 2023 13:43:31 +0100 Subject: [PATCH 07/12] fix lint action --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 18513a4..a85d5f3 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -12,7 +12,7 @@ jobs: name: Run linters runs-on: ubuntu-latest container: - image: node:14 + image: node:14.17.4 steps: - name: Check out Git repository From e1eab18835c8948979e69994702252f4dd8fd010 Mon Sep 17 00:00:00 2001 From: Philipp Wundrack Date: Tue, 21 Mar 2023 13:45:11 +0100 Subject: [PATCH 08/12] fix lint action --- .github/workflows/lint.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index a85d5f3..302353a 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -18,6 +18,9 @@ jobs: - name: Check out Git repository uses: actions/checkout@v2 + - name: Upgrade NPM + run: npm install -g npm + # ESLint and Prettier must be in `package.json` - name: Install Node.js dependencies from package-lock.json run: npm clean-install From c781c3d96765514d61cc73306132cf72aa3f584d Mon Sep 17 00:00:00 2001 From: Philipp Wundrack Date: Tue, 21 Mar 2023 13:53:01 +0100 Subject: [PATCH 09/12] fix lint action --- .github/workflows/lint.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 302353a..da00b2d 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -11,19 +11,19 @@ jobs: run-linters: name: Run linters runs-on: ubuntu-latest - container: - image: node:14.17.4 steps: - name: Check out Git repository uses: actions/checkout@v2 - - name: Upgrade NPM - run: npm install -g npm + - name: Set up Node.js + uses: actions/setup-node@v1 + with: + node-version: 17 # ESLint and Prettier must be in `package.json` - name: Install Node.js dependencies from package-lock.json - run: npm clean-install + run: npm clean-install --legacy-peer-deps - name: Run linters run: npm run lint From 08f8729171e1cc201134031bc1a799c56360b6d4 Mon Sep 17 00:00:00 2001 From: Philipp Wundrack Date: Tue, 21 Mar 2023 13:55:34 +0100 Subject: [PATCH 10/12] update actions --- .github/workflows/lint.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index da00b2d..3562796 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -14,10 +14,10 @@ jobs: steps: - name: Check out Git repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Set up Node.js - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 with: node-version: 17 From d87a9ac07e850f0b624479f3c3451316d715bd6b Mon Sep 17 00:00:00 2001 From: PhilWun Date: Tue, 21 Mar 2023 17:27:26 +0100 Subject: [PATCH 11/12] Update metadata action --- .github/workflows/docker_image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker_image.yml b/.github/workflows/docker_image.yml index 5bf704e..80dff48 100644 --- a/.github/workflows/docker_image.yml +++ b/.github/workflows/docker_image.yml @@ -20,7 +20,7 @@ jobs: uses: docker/setup-qemu-action@v2 - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@v3 + uses: docker/metadata-action@v4 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - name: Set up Docker Buildx From 9b37af49e643aeb16c19a39b15fd2af21bd758c0 Mon Sep 17 00:00:00 2001 From: PhilWun Date: Wed, 22 Mar 2023 14:54:16 +0100 Subject: [PATCH 12/12] fix step name --- .github/workflows/docker_image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker_image.yml b/.github/workflows/docker_image.yml index 80dff48..2953381 100644 --- a/.github/workflows/docker_image.yml +++ b/.github/workflows/docker_image.yml @@ -25,7 +25,7 @@ jobs: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - - name: Login to DockerHub + - name: Login to GitHub registry uses: docker/login-action@v2 with: registry: ${{ env.REGISTRY }}