From ae3225c5a41c41c47f73459c4181416d78c2ea15 Mon Sep 17 00:00:00 2001 From: kkmanos Date: Thu, 16 May 2024 14:18:59 +0300 Subject: [PATCH] added workflows for every wallet enterprise instance and push on new release --- .github/workflows/docker-build-push.yml | 6 ++- ...-image-wallet-enterprise-acme-verifier.yml | 19 ++++++++++ ...image-wallet-enterprise-diploma-issuer.yml | 19 ++++++++++ ...er-image-wallet-enterprise-ehic-issuer.yml | 19 ++++++++++ ...ker-image-wallet-enterprise-vid-issuer.yml | 19 ++++++++++ ...r-push-wallet-enterprise-acme-verifier.yml | 20 ++++++++++ ...-push-wallet-enterprise-diploma-issuer.yml | 20 ++++++++++ ...ker-push-wallet-enterprise-ehic-issuer.yml | 20 ++++++++++ ...cker-push-wallet-enterprise-vid-issuer.yml | 20 ++++++++++ .../acme-verifier/Dockerfile | 37 +++++++++++++++++++ .../diploma-issuer/Dockerfile | 32 ++++++++++++++++ .../ehic-issuer/Dockerfile | 32 ++++++++++++++++ .../vid-issuer/Dockerfile | 31 ++++++++++++++++ 13 files changed, 293 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/docker-image-wallet-enterprise-acme-verifier.yml create mode 100644 .github/workflows/docker-image-wallet-enterprise-diploma-issuer.yml create mode 100644 .github/workflows/docker-image-wallet-enterprise-ehic-issuer.yml create mode 100644 .github/workflows/docker-image-wallet-enterprise-vid-issuer.yml create mode 100644 .github/workflows/docker-push-wallet-enterprise-acme-verifier.yml create mode 100644 .github/workflows/docker-push-wallet-enterprise-diploma-issuer.yml create mode 100644 .github/workflows/docker-push-wallet-enterprise-ehic-issuer.yml create mode 100644 .github/workflows/docker-push-wallet-enterprise-vid-issuer.yml create mode 100755 wallet-enterprise-configurations/acme-verifier/Dockerfile create mode 100755 wallet-enterprise-configurations/diploma-issuer/Dockerfile create mode 100755 wallet-enterprise-configurations/ehic-issuer/Dockerfile create mode 100755 wallet-enterprise-configurations/vid-issuer/Dockerfile diff --git a/.github/workflows/docker-build-push.yml b/.github/workflows/docker-build-push.yml index 7f28a22..3fe0d20 100644 --- a/.github/workflows/docker-build-push.yml +++ b/.github/workflows/docker-build-push.yml @@ -11,6 +11,10 @@ on: type: boolean required: true + dockerfile-path: + type: string + required: true + jobs: build: runs-on: ubuntu-latest @@ -32,7 +36,7 @@ jobs: - uses: docker/build-push-action@v3 with: context: . - file: ./Dockerfile + file: ${{ inputs.dockerfile-path }} push: ${{ inputs.docker-push }} tags: ${{ inputs.image-tag }} secret-files: | diff --git a/.github/workflows/docker-image-wallet-enterprise-acme-verifier.yml b/.github/workflows/docker-image-wallet-enterprise-acme-verifier.yml new file mode 100644 index 0000000..1042e43 --- /dev/null +++ b/.github/workflows/docker-image-wallet-enterprise-acme-verifier.yml @@ -0,0 +1,19 @@ +name: Build Docker image +on: + push: + branches-ignore: + - master + pull_request: + +jobs: + build-acme: + permissions: + contents: read + packages: read + + uses: ./.github/workflows/docker-build-push.yml + secrets: inherit + with: + image-tag: ghcr.io/wwwallet/wallet-enterprise-acme-verifier:latest + docker-push: false + dockerfile-path: ./wallet-enterprise-configurations/acme-verifier/Dockerfile diff --git a/.github/workflows/docker-image-wallet-enterprise-diploma-issuer.yml b/.github/workflows/docker-image-wallet-enterprise-diploma-issuer.yml new file mode 100644 index 0000000..6f3b130 --- /dev/null +++ b/.github/workflows/docker-image-wallet-enterprise-diploma-issuer.yml @@ -0,0 +1,19 @@ +name: Build Docker image +on: + push: + branches-ignore: + - master + pull_request: + +jobs: + build-diploma: + permissions: + contents: read + packages: read + + uses: ./.github/workflows/docker-build-push.yml + secrets: inherit + with: + image-tag: ghcr.io/wwwallet/wallet-enterprise-diploma-issuer:latest + docker-push: false + dockerfile-path: ./wallet-enterprise-configurations/diploma-issuer/Dockerfile diff --git a/.github/workflows/docker-image-wallet-enterprise-ehic-issuer.yml b/.github/workflows/docker-image-wallet-enterprise-ehic-issuer.yml new file mode 100644 index 0000000..a9ab4e7 --- /dev/null +++ b/.github/workflows/docker-image-wallet-enterprise-ehic-issuer.yml @@ -0,0 +1,19 @@ +name: Build Docker image +on: + push: + branches-ignore: + - master + pull_request: + +jobs: + build-ehic: + permissions: + contents: read + packages: read + + uses: ./.github/workflows/docker-build-push.yml + secrets: inherit + with: + image-tag: ghcr.io/wwwallet/wallet-enterprise-ehic-issuer:latest + docker-push: false + dockerfile-path: ./wallet-enterprise-configurations/ehic-issuer/Dockerfile diff --git a/.github/workflows/docker-image-wallet-enterprise-vid-issuer.yml b/.github/workflows/docker-image-wallet-enterprise-vid-issuer.yml new file mode 100644 index 0000000..f95b968 --- /dev/null +++ b/.github/workflows/docker-image-wallet-enterprise-vid-issuer.yml @@ -0,0 +1,19 @@ +name: Build Docker image +on: + push: + branches-ignore: + - master + pull_request: + +jobs: + build-vid: + permissions: + contents: read + packages: read + + uses: ./.github/workflows/docker-build-push.yml + secrets: inherit + with: + image-tag: ghcr.io/wwwallet/wallet-enterprise-vid-issuer:latest + docker-push: false + dockerfile-path: ./wallet-enterprise-configurations/vid-issuer/Dockerfile diff --git a/.github/workflows/docker-push-wallet-enterprise-acme-verifier.yml b/.github/workflows/docker-push-wallet-enterprise-acme-verifier.yml new file mode 100644 index 0000000..e675e0d --- /dev/null +++ b/.github/workflows/docker-push-wallet-enterprise-acme-verifier.yml @@ -0,0 +1,20 @@ +name: Push Docker image +on: + push: + tags: + - v0.* + - v1.* + - v2.* + +jobs: + push-acme: + permissions: + contents: read + packages: write + + uses: ./.github/workflows/docker-build-push.yml + secrets: inherit + with: + image-tag: ghcr.io/wwwallet/wallet-enterprise-acme-verifier:${{ github.ref_name }} + docker-push: true + dockerfile-path: ./wallet-enterprise-configurations/acme-verifier/Dockerfile diff --git a/.github/workflows/docker-push-wallet-enterprise-diploma-issuer.yml b/.github/workflows/docker-push-wallet-enterprise-diploma-issuer.yml new file mode 100644 index 0000000..2dd9c36 --- /dev/null +++ b/.github/workflows/docker-push-wallet-enterprise-diploma-issuer.yml @@ -0,0 +1,20 @@ +name: Push Docker image +on: + push: + tags: + - v0.* + - v1.* + - v2.* + +jobs: + push-diploma: + permissions: + contents: read + packages: write + + uses: ./.github/workflows/docker-build-push.yml + secrets: inherit + with: + image-tag: ghcr.io/wwwallet/wallet-enterprise-diploma-issuer:${{ github.ref_name }} + docker-push: true + dockerfile-path: ./wallet-enterprise-configurations/diploma-issuer/Dockerfile diff --git a/.github/workflows/docker-push-wallet-enterprise-ehic-issuer.yml b/.github/workflows/docker-push-wallet-enterprise-ehic-issuer.yml new file mode 100644 index 0000000..39abb94 --- /dev/null +++ b/.github/workflows/docker-push-wallet-enterprise-ehic-issuer.yml @@ -0,0 +1,20 @@ +name: Push Docker image +on: + push: + tags: + - v0.* + - v1.* + - v2.* + +jobs: + push-ehic: + permissions: + contents: read + packages: write + + uses: ./.github/workflows/docker-build-push.yml + secrets: inherit + with: + image-tag: ghcr.io/wwwallet/wallet-enterprise-ehic-issuer:${{ github.ref_name }} + docker-push: true + dockerfile-path: ./wallet-enterprise-configurations/ehic-issuer/Dockerfile diff --git a/.github/workflows/docker-push-wallet-enterprise-vid-issuer.yml b/.github/workflows/docker-push-wallet-enterprise-vid-issuer.yml new file mode 100644 index 0000000..da66d5c --- /dev/null +++ b/.github/workflows/docker-push-wallet-enterprise-vid-issuer.yml @@ -0,0 +1,20 @@ +name: Push Docker image +on: + push: + tags: + - v0.* + - v1.* + - v2.* + +jobs: + push-vid: + permissions: + contents: read + packages: write + + uses: ./.github/workflows/docker-build-push.yml + secrets: inherit + with: + image-tag: ghcr.io/wwwallet/wallet-enterprise-vid-issuer:${{ github.ref_name }} + docker-push: true + dockerfile-path: ./wallet-enterprise-configurations/vid-issuer/Dockerfile diff --git a/wallet-enterprise-configurations/acme-verifier/Dockerfile b/wallet-enterprise-configurations/acme-verifier/Dockerfile new file mode 100755 index 0000000..2c7e0aa --- /dev/null +++ b/wallet-enterprise-configurations/acme-verifier/Dockerfile @@ -0,0 +1,37 @@ +# Builder stage +FROM ghcr.io/wwwallet/wallet-enterprise:base AS builder +WORKDIR /app + + +COPY wallet-enterprise/ . +RUN rm -rf /app/src/configuration/ +COPY ./wallet-enterprise-configurations/acme-verifier/src/configuration/ /app/src/configuration/ +COPY ./wallet-enterprise-configurations/acme-verifier/views/index.pug /app/views/index.pug +COPY ./wallet-enterprise-configurations/acme-verifier/views/header.pug /app/views/header.pug +COPY ./wallet-enterprise-configurations/acme-verifier/views/verifier/public_definitions.pug /app/views/verifier/public_definitions.pug +COPY ./wallet-enterprise-configurations/acme-verifier/views/verifier/QR.pug /app/views/verifier/QR.pug +COPY ./wallet-enterprise-configurations/acme-verifier/views/verifier/success.pug /app/views/verifier/success.pug +COPY ./wallet-enterprise-configurations/acme-verifier/public/styles/styles.css /app/public/styles/styles.css +COPY ./wallet-enterprise-configurations/acme-verifier/public/images /app/public/images + +RUN --mount=type=secret,id=npmrc,required=true,target=./.npmrc,uid=1000 \ + yarn cache clean && yarn install && yarn build + +# Production stage +FROM node:16-bullseye-slim AS production +WORKDIR /app + +COPY --from=builder /app/package.json . +COPY --from=builder /app/dist ./dist +COPY --from=builder /app/public ./public +COPY --from=builder /app/views/ ./views/ + + +RUN --mount=type=secret,id=npmrc,required=true,target=./.npmrc,uid=1000 \ + yarn cache clean && yarn install --production + + +ENV NODE_ENV production +EXPOSE 8003 + +CMD ["node", "./dist/src/app.js"] \ No newline at end of file diff --git a/wallet-enterprise-configurations/diploma-issuer/Dockerfile b/wallet-enterprise-configurations/diploma-issuer/Dockerfile new file mode 100755 index 0000000..beb42dc --- /dev/null +++ b/wallet-enterprise-configurations/diploma-issuer/Dockerfile @@ -0,0 +1,32 @@ +# Builder stage +FROM ghcr.io/wwwallet/wallet-enterprise:base AS builder +WORKDIR /app + +COPY wallet-enterprise/ . +RUN rm -rf src/configuration/ +COPY ./wallet-enterprise-configurations/diploma-issuer/src/configuration /app/src/configuration +COPY ./wallet-enterprise-configurations/diploma-issuer/views/issuer/login.pug /app/views/issuer/login.pug +COPY ./wallet-enterprise-configurations/diploma-issuer/public/styles/styles.css /app/public/styles/styles.css +COPY ./wallet-enterprise-configurations/diploma-issuer/public/images /app/public/images +COPY ./wallet-enterprise-configurations/diploma-issuer/views/header.pug /app/views/header.pug +COPY ./wallet-enterprise-configurations/diploma-issuer/views/index.pug /app/views/index.pug + +RUN --mount=type=secret,id=npmrc,required=true,target=./.npmrc,uid=1000 \ + yarn cache clean && yarn install && yarn build + +# Production stage +FROM node:16-bullseye-slim AS production +WORKDIR /app + +COPY --from=builder /app/package.json . +COPY --from=builder /app/dist/ ./dist/ +COPY --from=builder /app/public/ ./public/ +COPY --from=builder /app/views/ ./views/ + +RUN --mount=type=secret,id=npmrc,required=true,target=./.npmrc,uid=1000 \ + yarn cache clean && yarn install --production + +ENV NODE_ENV production +EXPOSE 8003 + +CMD ["node", "./dist/src/app.js"] \ No newline at end of file diff --git a/wallet-enterprise-configurations/ehic-issuer/Dockerfile b/wallet-enterprise-configurations/ehic-issuer/Dockerfile new file mode 100755 index 0000000..b6295e7 --- /dev/null +++ b/wallet-enterprise-configurations/ehic-issuer/Dockerfile @@ -0,0 +1,32 @@ +# Builder stage +FROM ghcr.io/wwwallet/wallet-enterprise:base AS builder +WORKDIR /app + +COPY wallet-enterprise/ . +RUN rm -rf src/configuration/ +COPY ./wallet-enterprise-configurations/ehic-issuer/src/configuration/ src/configuration/ +COPY ./wallet-enterprise-configurations/ehic-issuer/public/styles/styles.css public/styles/styles.css +COPY ./wallet-enterprise-configurations/ehic-issuer/views/index.pug views/index.pug +COPY ./wallet-enterprise-configurations/ehic-issuer/views/header.pug views/header.pug + + +RUN --mount=type=secret,id=npmrc,required=true,target=./.npmrc,uid=1000 \ + yarn cache clean && yarn install && yarn build + +# Production stage +FROM node:16-bullseye-slim AS production +WORKDIR /app + +COPY --from=builder /app/package.json . +COPY --from=builder /app/dist/ ./dist/ +COPY --from=builder /app/public/ ./public/ +COPY --from=builder /app/views/ ./views/ + + +RUN --mount=type=secret,id=npmrc,required=true,target=./.npmrc,uid=1000 \ + yarn cache clean && yarn install --production + +ENV NODE_ENV production +EXPOSE 8003 + +CMD ["node", "./dist/src/app.js"] \ No newline at end of file diff --git a/wallet-enterprise-configurations/vid-issuer/Dockerfile b/wallet-enterprise-configurations/vid-issuer/Dockerfile new file mode 100755 index 0000000..a9218bd --- /dev/null +++ b/wallet-enterprise-configurations/vid-issuer/Dockerfile @@ -0,0 +1,31 @@ +# Builder stage +FROM ghcr.io/wwwallet/wallet-enterprise:base AS builder +WORKDIR /app + +COPY wallet-enterprise/ . +RUN rm -rf src/configuration/ +COPY ./wallet-enterprise-configurations/vid-issuer/src/configuration/ src/configuration/ +COPY ./wallet-enterprise-configurations/vid-issuer/public/styles/styles.css public/styles/styles.css +COPY ./wallet-enterprise-configurations/vid-issuer/public/images/ public/images/ +COPY ./wallet-enterprise-configurations/vid-issuer/views/header.pug /app/views/header.pug +COPY ./wallet-enterprise-configurations/vid-issuer/views/index.pug /app/views/index.pug + +RUN --mount=type=secret,id=npmrc,required=true,target=./.npmrc,uid=1000 \ + yarn cache clean && yarn install && yarn build + +# Production stage +FROM node:16-bullseye-slim AS production +WORKDIR /app + +COPY --from=builder /app/package.json . +COPY --from=builder /app/dist/ ./dist/ +COPY --from=builder /app/public/ ./public/ +COPY --from=builder /app/views/ ./views/ + +RUN --mount=type=secret,id=npmrc,required=true,target=./.npmrc,uid=1000 \ + yarn cache clean && yarn install --production + +ENV NODE_ENV production +EXPOSE 8003 + +CMD ["node", "./dist/src/app.js"] \ No newline at end of file