From 56c758ab6683836d6125f9edab95da91ffc8e10d Mon Sep 17 00:00:00 2001 From: Lasse Alm Date: Thu, 7 Nov 2024 14:02:57 +0100 Subject: [PATCH 1/7] migrate to github actions --- .github/workflows/release-dapp-esealing.yaml | 14 +++++ .github/workflows/release-dapp-voting.yaml | 14 +++++ .github/workflows/release-dapp-wccd.yaml | 56 ++++++++++++++++++++ examples/eSealing/Dockerfile | 15 +++--- examples/voting/Dockerfile | 15 +++--- examples/wCCD/Dockerfile | 15 +++--- 6 files changed, 108 insertions(+), 21 deletions(-) create mode 100644 .github/workflows/release-dapp-esealing.yaml create mode 100644 .github/workflows/release-dapp-voting.yaml create mode 100644 .github/workflows/release-dapp-wccd.yaml diff --git a/.github/workflows/release-dapp-esealing.yaml b/.github/workflows/release-dapp-esealing.yaml new file mode 100644 index 000000000..8e724e31b --- /dev/null +++ b/.github/workflows/release-dapp-esealing.yaml @@ -0,0 +1,14 @@ +on: + push: + tags: + - dapp-esealing/* + +jobs: + release-base-image: + uses: concordium/.github/.github/workflows/docker-release-workflow.yaml@v1 + with: + SERVICE_NAME: "dapp-esealing" + BUILD_ARGS: | + base_image=node:18-slim + DOCKER_FILE_PATH: examples/eSealing + secrets: inherit diff --git a/.github/workflows/release-dapp-voting.yaml b/.github/workflows/release-dapp-voting.yaml new file mode 100644 index 000000000..790d9333e --- /dev/null +++ b/.github/workflows/release-dapp-voting.yaml @@ -0,0 +1,14 @@ +on: + push: + tags: + - dapp-voting/* + +jobs: + release-base-image: + uses: concordium/.github/.github/workflows/docker-release-workflow.yaml@v1 + with: + SERVICE_NAME: "dapp-voting" + BUILD_ARGS: | + base_image=node:18-slim + DOCKER_FILE_PATH: examples/voting + secrets: inherit diff --git a/.github/workflows/release-dapp-wccd.yaml b/.github/workflows/release-dapp-wccd.yaml new file mode 100644 index 000000000..4d1886bb4 --- /dev/null +++ b/.github/workflows/release-dapp-wccd.yaml @@ -0,0 +1,56 @@ +on: + push: + tags: + - dapp-wccd/* + +env: + BASE_IMAGE: "node:18-slim" + +jobs: + release-docker: + runs-on: ubuntu-latest + environment: release + strategy: + fail-fast: false + matrix: + env: + - "testnet" + - "mainnet" + steps: + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: 'concordium' + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Clone repo + uses: actions/checkout@v4 + + - name: Set image tag if correctly formatted + env: + TAG: ${{ github.ref_name }} + run: | + TAG_VERSION=${{ matrix.env }}-${TAG##${{ inputs.SERVICE_NAME }}/} + echo "FULL_IMAGE_TAG=concordium/${{ inputs.SERVICE_NAME }}:${TAG_VERSION}" >> $GITHUB_ENV + + - name: Check if image exist + run: | + set +e + docker manifest inspect ${{ env.FULL_IMAGE_TAG }} + EXITCODE=$? + if [ $EXITCODE -eq "0" ]; then + echo "Error: ${{ env.FULL_IMAGE_TAG }} already exist" + exit 1 + fi + + - name: Build Docker Image + uses: docker/build-push-action@v6 + with: + context: . + file: ./examples/wCCD/Dockerfile + tags: ${{ env.FULL_IMAGE_TAG }} + no-cache: true + push: true + build-args: | + base_image=${{ env.BASE_IMAGE }} + NETWORK=${{ matrix.env }} diff --git a/examples/eSealing/Dockerfile b/examples/eSealing/Dockerfile index 6a12fcad3..f066f905e 100644 --- a/examples/eSealing/Dockerfile +++ b/examples/eSealing/Dockerfile @@ -3,16 +3,17 @@ ARG base_image=node:18-slim FROM ${base_image} AS build WORKDIR /app -COPY ./package.json ./package.json -COPY ./tsconfig.json ./tsconfig.json -COPY ./index.html ./ -COPY ./vite.config.ts ./ -COPY ./public ./public -COPY ./src ./src +COPY ./examples/eSealing/package.json ./package.json +COPY ./examples/eSealing/tsconfig.json ./tsconfig.json +COPY ./examples/eSealing/index.html ./ +COPY ./examples/eSealing/vite.config.ts ./ +COPY ./examples/eSealing/public ./public +COPY ./examples/eSealing/src ./src RUN yarn && yarn cache clean RUN yarn build FROM nginx +LABEL build_image="${build_image}" COPY --from=build ./app/dist ./usr/share/nginx/html -COPY ./nginx.conf /etc/nginx/conf.d/default.conf +COPY ./examples/eSealing/nginx.conf /etc/nginx/conf.d/default.conf diff --git a/examples/voting/Dockerfile b/examples/voting/Dockerfile index 6a12fcad3..e645d3a80 100644 --- a/examples/voting/Dockerfile +++ b/examples/voting/Dockerfile @@ -3,16 +3,17 @@ ARG base_image=node:18-slim FROM ${base_image} AS build WORKDIR /app -COPY ./package.json ./package.json -COPY ./tsconfig.json ./tsconfig.json -COPY ./index.html ./ -COPY ./vite.config.ts ./ -COPY ./public ./public -COPY ./src ./src +COPY ./examples/voting/package.json ./package.json +COPY ./examples/voting/tsconfig.json ./tsconfig.json +COPY ./examples/voting/index.html ./ +COPY ./examples/voting/vite.config.ts ./ +COPY ./examples/voting/public ./public +COPY ./examples/voting/src ./src RUN yarn && yarn cache clean RUN yarn build FROM nginx +LABEL build_image="${build_image}" COPY --from=build ./app/dist ./usr/share/nginx/html -COPY ./nginx.conf /etc/nginx/conf.d/default.conf +COPY ./examples/voting/nginx.conf /etc/nginx/conf.d/default.conf diff --git a/examples/wCCD/Dockerfile b/examples/wCCD/Dockerfile index fac0d47d5..ea6715ae3 100644 --- a/examples/wCCD/Dockerfile +++ b/examples/wCCD/Dockerfile @@ -3,12 +3,12 @@ ARG base_image=node:18-slim FROM ${base_image} AS build WORKDIR /app -COPY ./package.json ./package.json -COPY ./tsconfig.json ./tsconfig.json -COPY ./index.html ./ -COPY ./vite.config.ts ./ -COPY ./public ./public -COPY ./src ./src +COPY ./examples/wCCD/package.json ./package.json +COPY ./examples/wCCD/tsconfig.json ./tsconfig.json +COPY ./examples/wCCD/index.html ./ +COPY ./examples/wCCD/vite.config.ts ./ +COPY ./examples/wCCD/public ./public +COPY ./examples/wCCD/src ./src RUN yarn && yarn cache clean @@ -18,5 +18,6 @@ RUN if [ "$NETWORK" = "testnet" ]; then yarn build; fi RUN if [ "$NETWORK" = "mainnet" ]; then yarn build-prod; fi FROM nginx +LABEL build_image="${build_image}" COPY --from=build ./app/dist ./usr/share/nginx/html -COPY ./nginx.conf /etc/nginx/conf.d/default.conf +COPY ./examples/wCCD/nginx.conf /etc/nginx/conf.d/default.conf From 11b1efd5ad4d26db149e4f8dd5e9c401e92e1b98 Mon Sep 17 00:00:00 2001 From: Lasse Alm Date: Thu, 7 Nov 2024 15:49:26 +0100 Subject: [PATCH 2/7] release dapps --- .github/workflows/release-dapp-esealing.yaml | 7 +-- .github/workflows/release-dapp-voting.yaml | 3 +- .github/workflows/release-dapp-wccd.yaml | 56 -------------------- examples/eSealing/Dockerfile | 14 ++--- examples/voting/Dockerfile | 14 ++--- examples/wCCD/Dockerfile | 14 ++--- 6 files changed, 27 insertions(+), 81 deletions(-) delete mode 100644 .github/workflows/release-dapp-wccd.yaml diff --git a/.github/workflows/release-dapp-esealing.yaml b/.github/workflows/release-dapp-esealing.yaml index 8e724e31b..179eec785 100644 --- a/.github/workflows/release-dapp-esealing.yaml +++ b/.github/workflows/release-dapp-esealing.yaml @@ -5,10 +5,11 @@ on: jobs: release-base-image: - uses: concordium/.github/.github/workflows/docker-release-workflow.yaml@v1 + uses: concordium/.github/.github/workflows/docker-release-workflow.yaml@main with: - SERVICE_NAME: "dapp-esealing" + DOCKER_FILE_PATH: ./examples/eSealing/Dockerfile + DOCKER_CONTEXT: examples/eSealing BUILD_ARGS: | base_image=node:18-slim - DOCKER_FILE_PATH: examples/eSealing + SERVICE_NAME: "dapp-esealing" secrets: inherit diff --git a/.github/workflows/release-dapp-voting.yaml b/.github/workflows/release-dapp-voting.yaml index 790d9333e..2ea134061 100644 --- a/.github/workflows/release-dapp-voting.yaml +++ b/.github/workflows/release-dapp-voting.yaml @@ -5,9 +5,10 @@ on: jobs: release-base-image: - uses: concordium/.github/.github/workflows/docker-release-workflow.yaml@v1 + uses: concordium/.github/.github/workflows/docker-release-workflow.yaml@main with: SERVICE_NAME: "dapp-voting" + DOCKER_CONTEXT: "./examples/voting" BUILD_ARGS: | base_image=node:18-slim DOCKER_FILE_PATH: examples/voting diff --git a/.github/workflows/release-dapp-wccd.yaml b/.github/workflows/release-dapp-wccd.yaml deleted file mode 100644 index 4d1886bb4..000000000 --- a/.github/workflows/release-dapp-wccd.yaml +++ /dev/null @@ -1,56 +0,0 @@ -on: - push: - tags: - - dapp-wccd/* - -env: - BASE_IMAGE: "node:18-slim" - -jobs: - release-docker: - runs-on: ubuntu-latest - environment: release - strategy: - fail-fast: false - matrix: - env: - - "testnet" - - "mainnet" - steps: - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - username: 'concordium' - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Clone repo - uses: actions/checkout@v4 - - - name: Set image tag if correctly formatted - env: - TAG: ${{ github.ref_name }} - run: | - TAG_VERSION=${{ matrix.env }}-${TAG##${{ inputs.SERVICE_NAME }}/} - echo "FULL_IMAGE_TAG=concordium/${{ inputs.SERVICE_NAME }}:${TAG_VERSION}" >> $GITHUB_ENV - - - name: Check if image exist - run: | - set +e - docker manifest inspect ${{ env.FULL_IMAGE_TAG }} - EXITCODE=$? - if [ $EXITCODE -eq "0" ]; then - echo "Error: ${{ env.FULL_IMAGE_TAG }} already exist" - exit 1 - fi - - - name: Build Docker Image - uses: docker/build-push-action@v6 - with: - context: . - file: ./examples/wCCD/Dockerfile - tags: ${{ env.FULL_IMAGE_TAG }} - no-cache: true - push: true - build-args: | - base_image=${{ env.BASE_IMAGE }} - NETWORK=${{ matrix.env }} diff --git a/examples/eSealing/Dockerfile b/examples/eSealing/Dockerfile index f066f905e..313f9321c 100644 --- a/examples/eSealing/Dockerfile +++ b/examples/eSealing/Dockerfile @@ -3,12 +3,12 @@ ARG base_image=node:18-slim FROM ${base_image} AS build WORKDIR /app -COPY ./examples/eSealing/package.json ./package.json -COPY ./examples/eSealing/tsconfig.json ./tsconfig.json -COPY ./examples/eSealing/index.html ./ -COPY ./examples/eSealing/vite.config.ts ./ -COPY ./examples/eSealing/public ./public -COPY ./examples/eSealing/src ./src +COPY ./package.json ./package.json +COPY ./tsconfig.json ./tsconfig.json +COPY ./index.html ./ +COPY ./vite.config.ts ./ +COPY ./public ./public +COPY ./src ./src RUN yarn && yarn cache clean RUN yarn build @@ -16,4 +16,4 @@ RUN yarn build FROM nginx LABEL build_image="${build_image}" COPY --from=build ./app/dist ./usr/share/nginx/html -COPY ./examples/eSealing/nginx.conf /etc/nginx/conf.d/default.conf +COPY ./nginx.conf /etc/nginx/conf.d/default.conf diff --git a/examples/voting/Dockerfile b/examples/voting/Dockerfile index e645d3a80..313f9321c 100644 --- a/examples/voting/Dockerfile +++ b/examples/voting/Dockerfile @@ -3,12 +3,12 @@ ARG base_image=node:18-slim FROM ${base_image} AS build WORKDIR /app -COPY ./examples/voting/package.json ./package.json -COPY ./examples/voting/tsconfig.json ./tsconfig.json -COPY ./examples/voting/index.html ./ -COPY ./examples/voting/vite.config.ts ./ -COPY ./examples/voting/public ./public -COPY ./examples/voting/src ./src +COPY ./package.json ./package.json +COPY ./tsconfig.json ./tsconfig.json +COPY ./index.html ./ +COPY ./vite.config.ts ./ +COPY ./public ./public +COPY ./src ./src RUN yarn && yarn cache clean RUN yarn build @@ -16,4 +16,4 @@ RUN yarn build FROM nginx LABEL build_image="${build_image}" COPY --from=build ./app/dist ./usr/share/nginx/html -COPY ./examples/voting/nginx.conf /etc/nginx/conf.d/default.conf +COPY ./nginx.conf /etc/nginx/conf.d/default.conf diff --git a/examples/wCCD/Dockerfile b/examples/wCCD/Dockerfile index ea6715ae3..e666d79a7 100644 --- a/examples/wCCD/Dockerfile +++ b/examples/wCCD/Dockerfile @@ -3,12 +3,12 @@ ARG base_image=node:18-slim FROM ${base_image} AS build WORKDIR /app -COPY ./examples/wCCD/package.json ./package.json -COPY ./examples/wCCD/tsconfig.json ./tsconfig.json -COPY ./examples/wCCD/index.html ./ -COPY ./examples/wCCD/vite.config.ts ./ -COPY ./examples/wCCD/public ./public -COPY ./examples/wCCD/src ./src +COPY ./package.json ./package.json +COPY ./tsconfig.json ./tsconfig.json +COPY ./index.html ./ +COPY ./vite.config.ts ./ +COPY ./public ./public +COPY ./src ./src RUN yarn && yarn cache clean @@ -20,4 +20,4 @@ RUN if [ "$NETWORK" = "mainnet" ]; then yarn build-prod; fi FROM nginx LABEL build_image="${build_image}" COPY --from=build ./app/dist ./usr/share/nginx/html -COPY ./examples/wCCD/nginx.conf /etc/nginx/conf.d/default.conf +COPY ./nginx.conf /etc/nginx/conf.d/default.conf From 5853200e8e0f4b430a79616bdcb707d09218456b Mon Sep 17 00:00:00 2001 From: Lasse Alm Date: Thu, 7 Nov 2024 15:49:45 +0100 Subject: [PATCH 3/7] revert dockerifle --- examples/wCCD/Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/wCCD/Dockerfile b/examples/wCCD/Dockerfile index e666d79a7..fac0d47d5 100644 --- a/examples/wCCD/Dockerfile +++ b/examples/wCCD/Dockerfile @@ -18,6 +18,5 @@ RUN if [ "$NETWORK" = "testnet" ]; then yarn build; fi RUN if [ "$NETWORK" = "mainnet" ]; then yarn build-prod; fi FROM nginx -LABEL build_image="${build_image}" COPY --from=build ./app/dist ./usr/share/nginx/html COPY ./nginx.conf /etc/nginx/conf.d/default.conf From 078fbc807bcb0787d204b475cc325ec0419978af Mon Sep 17 00:00:00 2001 From: Lasse Alm Date: Fri, 8 Nov 2024 09:15:19 +0100 Subject: [PATCH 4/7] alter browser wallet files --- .github/workflows/release-dapp-esealing.yaml | 2 +- .github/workflows/release-dapp-voting.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-dapp-esealing.yaml b/.github/workflows/release-dapp-esealing.yaml index 179eec785..3a1cd6e91 100644 --- a/.github/workflows/release-dapp-esealing.yaml +++ b/.github/workflows/release-dapp-esealing.yaml @@ -4,7 +4,7 @@ on: - dapp-esealing/* jobs: - release-base-image: + release-dapp-esealing-image: uses: concordium/.github/.github/workflows/docker-release-workflow.yaml@main with: DOCKER_FILE_PATH: ./examples/eSealing/Dockerfile diff --git a/.github/workflows/release-dapp-voting.yaml b/.github/workflows/release-dapp-voting.yaml index 2ea134061..40d323ce3 100644 --- a/.github/workflows/release-dapp-voting.yaml +++ b/.github/workflows/release-dapp-voting.yaml @@ -4,7 +4,7 @@ on: - dapp-voting/* jobs: - release-base-image: + release-dapp-voting-image: uses: concordium/.github/.github/workflows/docker-release-workflow.yaml@main with: SERVICE_NAME: "dapp-voting" From e46e13ccc9f415b7b159815da7ee39017412d59a Mon Sep 17 00:00:00 2001 From: Lasse Alm Date: Fri, 8 Nov 2024 09:16:07 +0100 Subject: [PATCH 5/7] use v1 --- .github/workflows/release-dapp-esealing.yaml | 2 +- .github/workflows/release-dapp-voting.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-dapp-esealing.yaml b/.github/workflows/release-dapp-esealing.yaml index 3a1cd6e91..4c423b878 100644 --- a/.github/workflows/release-dapp-esealing.yaml +++ b/.github/workflows/release-dapp-esealing.yaml @@ -5,7 +5,7 @@ on: jobs: release-dapp-esealing-image: - uses: concordium/.github/.github/workflows/docker-release-workflow.yaml@main + uses: concordium/.github/.github/workflows/docker-release-workflow.yaml@v1 with: DOCKER_FILE_PATH: ./examples/eSealing/Dockerfile DOCKER_CONTEXT: examples/eSealing diff --git a/.github/workflows/release-dapp-voting.yaml b/.github/workflows/release-dapp-voting.yaml index 40d323ce3..66a45b0a8 100644 --- a/.github/workflows/release-dapp-voting.yaml +++ b/.github/workflows/release-dapp-voting.yaml @@ -5,7 +5,7 @@ on: jobs: release-dapp-voting-image: - uses: concordium/.github/.github/workflows/docker-release-workflow.yaml@main + uses: concordium/.github/.github/workflows/docker-release-workflow.yaml@v1 with: SERVICE_NAME: "dapp-voting" DOCKER_CONTEXT: "./examples/voting" From e583bef75f0e008fffe26418a2d8a8dc38ece289 Mon Sep 17 00:00:00 2001 From: Lasse Alm Date: Fri, 8 Nov 2024 09:30:26 +0100 Subject: [PATCH 6/7] fix Dockerfile path --- .github/workflows/release-dapp-voting.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-dapp-voting.yaml b/.github/workflows/release-dapp-voting.yaml index 66a45b0a8..0c154cc10 100644 --- a/.github/workflows/release-dapp-voting.yaml +++ b/.github/workflows/release-dapp-voting.yaml @@ -11,5 +11,5 @@ jobs: DOCKER_CONTEXT: "./examples/voting" BUILD_ARGS: | base_image=node:18-slim - DOCKER_FILE_PATH: examples/voting + DOCKER_FILE_PATH: examples/voting/Dockerfile secrets: inherit From 59dbd36a0c2523655a348e4127cf1a2a6a795943 Mon Sep 17 00:00:00 2001 From: Lasse Alm Date: Fri, 8 Nov 2024 11:04:33 +0100 Subject: [PATCH 7/7] bump version --- examples/eSealing/package.json | 2 +- examples/voting/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/eSealing/package.json b/examples/eSealing/package.json index 73ee5cae9..ff59f1f49 100644 --- a/examples/eSealing/package.json +++ b/examples/eSealing/package.json @@ -1,7 +1,7 @@ { "name": "e_sealing", "packageManager": "yarn@3.2.0", - "version": "1.1.4", + "version": "1.1.6", "license": "Apache-2.0", "dependencies": { "@concordium/react-components": "^0.4.0", diff --git a/examples/voting/package.json b/examples/voting/package.json index fe47291db..b34ee550c 100644 --- a/examples/voting/package.json +++ b/examples/voting/package.json @@ -1,7 +1,7 @@ { "name": "voting", "license": "Apache-2.0", - "version": "1.1.4", + "version": "1.1.6", "packageManager": "yarn@3.2.0", "dependencies": { "@concordium/browser-wallet-api-helpers": "^3.0.0",