From 0a4f0bacd35cbb8060ce67afaa1099ce62164eac Mon Sep 17 00:00:00 2001 From: Ruslan Konviser Date: Wed, 29 Nov 2023 22:04:24 +0100 Subject: [PATCH] chore: fix docker build and pass correctly NODE_ENV depending on env --- .deploy/api/Dockerfile | 11 +- .../workflows/docker-build-publish-demo.yml | 300 +++++++++--------- .../workflows/docker-build-publish-prod.yml | 300 +++++++++--------- .../workflows/docker-build-publish-stage.yml | 300 +++++++++--------- 4 files changed, 465 insertions(+), 446 deletions(-) diff --git a/.deploy/api/Dockerfile b/.deploy/api/Dockerfile index d99c069ed65..ae5d0e6e8b2 100644 --- a/.deploy/api/Dockerfile +++ b/.deploy/api/Dockerfile @@ -142,7 +142,7 @@ COPY --chown=node:node packages/plugins/changelog/package.json ./packages/plugin COPY --chown=node:node decorate-angular-cli.js lerna.json package.json yarn.lock ./ -RUN yarn install --network-timeout 1000000 --frozen-lockfile && yarn cache clean +RUN yarn install --network-timeout 1000000 --frozen-lockfile # RUN apk del build-dependencies make gcc g++ python2 py2-setuptools vips-dev FROM node:18-alpine3.17 AS prodDependencies @@ -190,7 +190,7 @@ COPY --chown=node:node packages/plugins/changelog/package.json ./packages/plugin COPY --chown=node:node package.json yarn.lock ./ -RUN yarn install --network-timeout 1000000 --frozen-lockfile --production && yarn cache clean +RUN yarn install --network-timeout 1000000 --frozen-lockfile --production # RUN apk del build-dependencies make gcc g++ python2 py2-setuptools vips-dev RUN rm -r node_modules/@angular @@ -211,6 +211,10 @@ WORKDIR /srv/gauzy RUN mkdir dist +# Copy the node_modules from the dependencies stage +COPY --from=dependencies /srv/gauzy/node_modules ./node_modules + +# Copy the compiled packages from the development stage COPY --chown=node:node --from=development /srv/gauzy . ENV CI=true @@ -252,6 +256,9 @@ RUN npm install pm2@4.5.1 -g && \ touch ormlogs.log && chown node:node ormlogs.log && chown node:node wait && \ chmod +x wait entrypoint.compose.sh entrypoint.prod.sh && chown -R node:node apps/ +# Clean up +RUN yarn cache clean + USER node:node ENV CI=true diff --git a/.github/workflows/docker-build-publish-demo.yml b/.github/workflows/docker-build-publish-demo.yml index ee0a782d6bd..9cefdf9378a 100644 --- a/.github/workflows/docker-build-publish-demo.yml +++ b/.github/workflows/docker-build-publish-demo.yml @@ -1,155 +1,159 @@ name: Build and Publish Docker Images Demo on: - push: - branches: [develop, temp] + push: + branches: [develop, temp] concurrency: - group: ${{ github.ref }}-${{ github.workflow }} - cancel-in-progress: true + group: ${{ github.ref }}-${{ github.workflow }} + cancel-in-progress: true jobs: - gauzy-api: - runs-on: buildjet-8vcpu-ubuntu-2204 - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Build - uses: docker/build-push-action@v4 - with: - context: . - file: ./.deploy/api/Dockerfile - load: true - platforms: linux/amd64 - tags: | - ghcr.io/ever-co/gauzy-api-demo:latest - everco/gauzy-api-demo:latest - registry.digitalocean.com/ever/gauzy-api-demo:latest - ${{ secrets.CW_DOCKER_REGISTRY }}/ever-co/gauzy-api-demo:latest - cache-from: type=registry,ref=everco/gauzy-api-demo:latest - cache-to: type=inline - - - name: Docker images list - run: | - sudo docker image list - - - name: Login to DockerHub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Push to Docker Hub Registry - run: | - docker push everco/gauzy-api-demo:latest - - - name: Install doctl - uses: digitalocean/action-doctl@v2 - with: - token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} - - - name: Log in to DigitalOcean Container Registry with short-lived credentials - run: doctl registry login --expiry-seconds 3600 - - - name: Push to DigitalOcean Registry - run: | - docker push registry.digitalocean.com/ever/gauzy-api-demo:latest - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GH_TOKEN }} - - - name: Push to Github Registry - run: | - docker push ghcr.io/ever-co/gauzy-api-demo:latest - - - name: Login to CW Container Registry - uses: docker/login-action@v2 - with: - registry: ${{ secrets.CW_DOCKER_REGISTRY }} - username: ${{ secrets.CW_DOCKER_USER }} - password: ${{ secrets.CW_DOCKER_USER_PASSWORD }} - - - name: Push to CW Registry - run: | - docker push ${{ secrets.CW_DOCKER_REGISTRY }}/ever-co/gauzy-api-demo:latest - - gauzy-webapp: - runs-on: buildjet-8vcpu-ubuntu-2204 - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Build and push - uses: docker/build-push-action@v4 - with: - context: . - file: ./.deploy/webapp/Dockerfile - load: true - tags: | - ghcr.io/ever-co/gauzy-webapp-demo:latest - everco/gauzy-webapp-demo:latest - registry.digitalocean.com/ever/gauzy-webapp-demo:latest - ${{ secrets.CW_DOCKER_REGISTRY }}/ever-co/gauzy-webapp-demo:latest - cache-from: type=registry,ref=everco/gauzy-webapp-demo:latest - cache-to: type=inline - - - name: Login to DockerHub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Push to Docker Hub Registry - run: | - docker push everco/gauzy-webapp-demo:latest - - - name: Install doctl - uses: digitalocean/action-doctl@v2 - with: - token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} - - - name: Log in to DigitalOcean Container Registry with short-lived credentials - run: doctl registry login --expiry-seconds 3600 - - - name: Push to DigitalOcean Registry - run: | - docker push registry.digitalocean.com/ever/gauzy-webapp-demo:latest - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GH_TOKEN }} - - - name: Push to Github Registry - run: | - docker push ghcr.io/ever-co/gauzy-webapp-demo:latest - - - name: Login to CW Container Registry - uses: docker/login-action@v2 - with: - registry: ${{ secrets.CW_DOCKER_REGISTRY }} - username: ${{ secrets.CW_DOCKER_USER }} - password: ${{ secrets.CW_DOCKER_USER_PASSWORD }} - - - name: Push to CW Registry - run: | - docker push ${{ secrets.CW_DOCKER_REGISTRY }}/ever-co/gauzy-webapp-demo:latest + gauzy-api: + runs-on: buildjet-8vcpu-ubuntu-2204 + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Build + uses: docker/build-push-action@v4 + with: + context: . + file: ./.deploy/api/Dockerfile + load: true + platforms: linux/amd64 + tags: | + ghcr.io/ever-co/gauzy-api-demo:latest + everco/gauzy-api-demo:latest + registry.digitalocean.com/ever/gauzy-api-demo:latest + ${{ secrets.CW_DOCKER_REGISTRY }}/ever-co/gauzy-api-demo:latest + cache-from: type=registry,ref=everco/gauzy-api-demo:latest + cache-to: type=inline + build-args: | + NODE_ENV=development + + - name: Docker images list + run: | + sudo docker image list + + - name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Push to Docker Hub Registry + run: | + docker push everco/gauzy-api-demo:latest + + - name: Install doctl + uses: digitalocean/action-doctl@v2 + with: + token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} + + - name: Log in to DigitalOcean Container Registry with short-lived credentials + run: doctl registry login --expiry-seconds 3600 + + - name: Push to DigitalOcean Registry + run: | + docker push registry.digitalocean.com/ever/gauzy-api-demo:latest + + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GH_TOKEN }} + + - name: Push to Github Registry + run: | + docker push ghcr.io/ever-co/gauzy-api-demo:latest + + - name: Login to CW Container Registry + uses: docker/login-action@v2 + with: + registry: ${{ secrets.CW_DOCKER_REGISTRY }} + username: ${{ secrets.CW_DOCKER_USER }} + password: ${{ secrets.CW_DOCKER_USER_PASSWORD }} + + - name: Push to CW Registry + run: | + docker push ${{ secrets.CW_DOCKER_REGISTRY }}/ever-co/gauzy-api-demo:latest + + gauzy-webapp: + runs-on: buildjet-8vcpu-ubuntu-2204 + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Build and push + uses: docker/build-push-action@v4 + with: + context: . + file: ./.deploy/webapp/Dockerfile + load: true + tags: | + ghcr.io/ever-co/gauzy-webapp-demo:latest + everco/gauzy-webapp-demo:latest + registry.digitalocean.com/ever/gauzy-webapp-demo:latest + ${{ secrets.CW_DOCKER_REGISTRY }}/ever-co/gauzy-webapp-demo:latest + cache-from: type=registry,ref=everco/gauzy-webapp-demo:latest + cache-to: type=inline + build-args: | + NODE_ENV=development + + - name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Push to Docker Hub Registry + run: | + docker push everco/gauzy-webapp-demo:latest + + - name: Install doctl + uses: digitalocean/action-doctl@v2 + with: + token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} + + - name: Log in to DigitalOcean Container Registry with short-lived credentials + run: doctl registry login --expiry-seconds 3600 + + - name: Push to DigitalOcean Registry + run: | + docker push registry.digitalocean.com/ever/gauzy-webapp-demo:latest + + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GH_TOKEN }} + + - name: Push to Github Registry + run: | + docker push ghcr.io/ever-co/gauzy-webapp-demo:latest + + - name: Login to CW Container Registry + uses: docker/login-action@v2 + with: + registry: ${{ secrets.CW_DOCKER_REGISTRY }} + username: ${{ secrets.CW_DOCKER_USER }} + password: ${{ secrets.CW_DOCKER_USER_PASSWORD }} + + - name: Push to CW Registry + run: | + docker push ${{ secrets.CW_DOCKER_REGISTRY }}/ever-co/gauzy-webapp-demo:latest diff --git a/.github/workflows/docker-build-publish-prod.yml b/.github/workflows/docker-build-publish-prod.yml index a888c10fe33..abe3fc7c905 100644 --- a/.github/workflows/docker-build-publish-prod.yml +++ b/.github/workflows/docker-build-publish-prod.yml @@ -1,155 +1,159 @@ name: Build and Publish Docker Images Prod on: - push: - branches: master + push: + branches: master concurrency: - group: ${{ github.ref }}-${{ github.workflow }} - cancel-in-progress: true + group: ${{ github.ref }}-${{ github.workflow }} + cancel-in-progress: true jobs: - gauzy-api: - runs-on: buildjet-8vcpu-ubuntu-2204 - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Build - uses: docker/build-push-action@v4 - with: - context: . - file: ./.deploy/api/Dockerfile - load: true - platforms: linux/amd64 - tags: | - ghcr.io/ever-co/gauzy-api:latest - everco/gauzy-api:latest - registry.digitalocean.com/ever/gauzy-api:latest - ${{ secrets.CW_DOCKER_REGISTRY }}/ever-co/gauzy-api:latest - cache-from: type=registry,ref=everco/gauzy-api:latest - cache-to: type=inline - - - name: Docker images list - run: | - sudo docker image list - - - name: Login to DockerHub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Push to Docker Hub Registry - run: | - docker push everco/gauzy-api:latest - - - name: Install doctl - uses: digitalocean/action-doctl@v2 - with: - token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} - - - name: Log in to DigitalOcean Container Registry with short-lived credentials - run: doctl registry login --expiry-seconds 3600 - - - name: Push to DigitalOcean Registry - run: | - docker push registry.digitalocean.com/ever/gauzy-api:latest - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GH_TOKEN }} - - - name: Push to Github Registry - run: | - docker push ghcr.io/ever-co/gauzy-api:latest - - - name: Login to CW Container Registry - uses: docker/login-action@v2 - with: - registry: ${{ secrets.CW_DOCKER_REGISTRY }} - username: ${{ secrets.CW_DOCKER_USER }} - password: ${{ secrets.CW_DOCKER_USER_PASSWORD }} - - - name: Push to CW Registry - run: | - docker push ${{ secrets.CW_DOCKER_REGISTRY }}/ever-co/gauzy-api:latest - - gauzy-webapp: - runs-on: buildjet-8vcpu-ubuntu-2204 - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Build and push - uses: docker/build-push-action@v4 - with: - context: . - file: ./.deploy/webapp/Dockerfile - load: true - tags: | - ghcr.io/ever-co/gauzy-webapp:latest - everco/gauzy-webapp:latest - registry.digitalocean.com/ever/gauzy-webapp:latest - ${{ secrets.CW_DOCKER_REGISTRY }}/ever-co/gauzy-webapp:latest - cache-from: type=registry,ref=everco/gauzy-webapp:latest - cache-to: type=inline - - - name: Login to DockerHub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Push to Docker Hub Registry - run: | - docker push everco/gauzy-webapp:latest - - - name: Install doctl - uses: digitalocean/action-doctl@v2 - with: - token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} - - - name: Log in to DigitalOcean Container Registry with short-lived credentials - run: doctl registry login --expiry-seconds 3600 - - - name: Push to DigitalOcean Registry - run: | - docker push registry.digitalocean.com/ever/gauzy-webapp:latest - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GH_TOKEN }} - - - name: Push to Github Registry - run: | - docker push ghcr.io/ever-co/gauzy-webapp:latest - - - name: Login to CW Container Registry - uses: docker/login-action@v2 - with: - registry: ${{ secrets.CW_DOCKER_REGISTRY }} - username: ${{ secrets.CW_DOCKER_USER }} - password: ${{ secrets.CW_DOCKER_USER_PASSWORD }} - - - name: Push to CW Registry - run: | - docker push ${{ secrets.CW_DOCKER_REGISTRY }}/ever-co/gauzy-webapp:latest + gauzy-api: + runs-on: buildjet-8vcpu-ubuntu-2204 + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Build + uses: docker/build-push-action@v4 + with: + context: . + file: ./.deploy/api/Dockerfile + load: true + platforms: linux/amd64 + tags: | + ghcr.io/ever-co/gauzy-api:latest + everco/gauzy-api:latest + registry.digitalocean.com/ever/gauzy-api:latest + ${{ secrets.CW_DOCKER_REGISTRY }}/ever-co/gauzy-api:latest + cache-from: type=registry,ref=everco/gauzy-api:latest + cache-to: type=inline + build-args: | + NODE_ENV=production + + - name: Docker images list + run: | + sudo docker image list + + - name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Push to Docker Hub Registry + run: | + docker push everco/gauzy-api:latest + + - name: Install doctl + uses: digitalocean/action-doctl@v2 + with: + token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} + + - name: Log in to DigitalOcean Container Registry with short-lived credentials + run: doctl registry login --expiry-seconds 3600 + + - name: Push to DigitalOcean Registry + run: | + docker push registry.digitalocean.com/ever/gauzy-api:latest + + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GH_TOKEN }} + + - name: Push to Github Registry + run: | + docker push ghcr.io/ever-co/gauzy-api:latest + + - name: Login to CW Container Registry + uses: docker/login-action@v2 + with: + registry: ${{ secrets.CW_DOCKER_REGISTRY }} + username: ${{ secrets.CW_DOCKER_USER }} + password: ${{ secrets.CW_DOCKER_USER_PASSWORD }} + + - name: Push to CW Registry + run: | + docker push ${{ secrets.CW_DOCKER_REGISTRY }}/ever-co/gauzy-api:latest + + gauzy-webapp: + runs-on: buildjet-8vcpu-ubuntu-2204 + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Build and push + uses: docker/build-push-action@v4 + with: + context: . + file: ./.deploy/webapp/Dockerfile + load: true + tags: | + ghcr.io/ever-co/gauzy-webapp:latest + everco/gauzy-webapp:latest + registry.digitalocean.com/ever/gauzy-webapp:latest + ${{ secrets.CW_DOCKER_REGISTRY }}/ever-co/gauzy-webapp:latest + cache-from: type=registry,ref=everco/gauzy-webapp:latest + cache-to: type=inline + build-args: | + NODE_ENV=production + + - name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Push to Docker Hub Registry + run: | + docker push everco/gauzy-webapp:latest + + - name: Install doctl + uses: digitalocean/action-doctl@v2 + with: + token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} + + - name: Log in to DigitalOcean Container Registry with short-lived credentials + run: doctl registry login --expiry-seconds 3600 + + - name: Push to DigitalOcean Registry + run: | + docker push registry.digitalocean.com/ever/gauzy-webapp:latest + + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GH_TOKEN }} + + - name: Push to Github Registry + run: | + docker push ghcr.io/ever-co/gauzy-webapp:latest + + - name: Login to CW Container Registry + uses: docker/login-action@v2 + with: + registry: ${{ secrets.CW_DOCKER_REGISTRY }} + username: ${{ secrets.CW_DOCKER_USER }} + password: ${{ secrets.CW_DOCKER_USER_PASSWORD }} + + - name: Push to CW Registry + run: | + docker push ${{ secrets.CW_DOCKER_REGISTRY }}/ever-co/gauzy-webapp:latest diff --git a/.github/workflows/docker-build-publish-stage.yml b/.github/workflows/docker-build-publish-stage.yml index dd520e2a1e6..be57f9387e4 100644 --- a/.github/workflows/docker-build-publish-stage.yml +++ b/.github/workflows/docker-build-publish-stage.yml @@ -1,155 +1,159 @@ name: Build and Publish Docker Images Stage on: - push: - branches: stage + push: + branches: stage concurrency: - group: ${{ github.ref }}-${{ github.workflow }} - cancel-in-progress: true + group: ${{ github.ref }}-${{ github.workflow }} + cancel-in-progress: true jobs: - gauzy-api: - runs-on: buildjet-8vcpu-ubuntu-2204 - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Build - uses: docker/build-push-action@v4 - with: - context: . - file: ./.deploy/api/Dockerfile - load: true - platforms: linux/amd64 - tags: | - ghcr.io/ever-co/gauzy-api-stage:latest - everco/gauzy-api-stage:latest - registry.digitalocean.com/ever/gauzy-api-stage:latest - ${{ secrets.CW_DOCKER_REGISTRY }}/ever-co/gauzy-api-stage:latest - cache-from: type=registry,ref=everco/gauzy-api-stage:latest - cache-to: type=inline - - - name: Docker images list - run: | - sudo docker image list - - - name: Login to DockerHub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Push to Docker Hub Registry - run: | - docker push everco/gauzy-api-stage:latest - - - name: Install doctl - uses: digitalocean/action-doctl@v2 - with: - token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} - - - name: Log in to DigitalOcean Container Registry with short-lived credentials - run: doctl registry login --expiry-seconds 3600 - - - name: Push to DigitalOcean Registry - run: | - docker push registry.digitalocean.com/ever/gauzy-api-stage:latest - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GH_TOKEN }} - - - name: Push to Github Registry - run: | - docker push ghcr.io/ever-co/gauzy-api-stage:latest - - - name: Login to CW Container Registry - uses: docker/login-action@v2 - with: - registry: ${{ secrets.CW_DOCKER_REGISTRY }} - username: ${{ secrets.CW_DOCKER_USER }} - password: ${{ secrets.CW_DOCKER_USER_PASSWORD }} - - - name: Push to CW Registry - run: | - docker push ${{ secrets.CW_DOCKER_REGISTRY }}/ever-co/gauzy-api-stage:latest - - gauzy-webapp: - runs-on: buildjet-8vcpu-ubuntu-2204 - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Build and push - uses: docker/build-push-action@v4 - with: - context: . - file: ./.deploy/webapp/Dockerfile - load: true - tags: | - ghcr.io/ever-co/gauzy-webapp-stage:latest - everco/gauzy-webapp-stage:latest - registry.digitalocean.com/ever/gauzy-webapp-stage:latest - ${{ secrets.CW_DOCKER_REGISTRY }}/ever-co/gauzy-webapp-stage:latest - cache-from: type=registry,ref=everco/gauzy-webapp-stage:latest - cache-to: type=inline - - - name: Login to DockerHub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Push to Docker Hub Registry - run: | - docker push everco/gauzy-webapp-stage:latest - - - name: Install doctl - uses: digitalocean/action-doctl@v2 - with: - token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} - - - name: Log in to DigitalOcean Container Registry with short-lived credentials - run: doctl registry login --expiry-seconds 3600 - - - name: Push to DigitalOcean Registry - run: | - docker push registry.digitalocean.com/ever/gauzy-webapp-stage:latest - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GH_TOKEN }} - - - name: Push to Github Registry - run: | - docker push ghcr.io/ever-co/gauzy-webapp-stage:latest - - - name: Login to CW Container Registry - uses: docker/login-action@v2 - with: - registry: ${{ secrets.CW_DOCKER_REGISTRY }} - username: ${{ secrets.CW_DOCKER_USER }} - password: ${{ secrets.CW_DOCKER_USER_PASSWORD }} - - - name: Push to CW Registry - run: | - docker push ${{ secrets.CW_DOCKER_REGISTRY }}/ever-co/gauzy-webapp-stage:latest + gauzy-api: + runs-on: buildjet-8vcpu-ubuntu-2204 + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Build + uses: docker/build-push-action@v4 + with: + context: . + file: ./.deploy/api/Dockerfile + load: true + platforms: linux/amd64 + tags: | + ghcr.io/ever-co/gauzy-api-stage:latest + everco/gauzy-api-stage:latest + registry.digitalocean.com/ever/gauzy-api-stage:latest + ${{ secrets.CW_DOCKER_REGISTRY }}/ever-co/gauzy-api-stage:latest + cache-from: type=registry,ref=everco/gauzy-api-stage:latest + cache-to: type=inline + build-args: | + NODE_ENV=development + + - name: Docker images list + run: | + sudo docker image list + + - name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Push to Docker Hub Registry + run: | + docker push everco/gauzy-api-stage:latest + + - name: Install doctl + uses: digitalocean/action-doctl@v2 + with: + token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} + + - name: Log in to DigitalOcean Container Registry with short-lived credentials + run: doctl registry login --expiry-seconds 3600 + + - name: Push to DigitalOcean Registry + run: | + docker push registry.digitalocean.com/ever/gauzy-api-stage:latest + + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GH_TOKEN }} + + - name: Push to Github Registry + run: | + docker push ghcr.io/ever-co/gauzy-api-stage:latest + + - name: Login to CW Container Registry + uses: docker/login-action@v2 + with: + registry: ${{ secrets.CW_DOCKER_REGISTRY }} + username: ${{ secrets.CW_DOCKER_USER }} + password: ${{ secrets.CW_DOCKER_USER_PASSWORD }} + + - name: Push to CW Registry + run: | + docker push ${{ secrets.CW_DOCKER_REGISTRY }}/ever-co/gauzy-api-stage:latest + + gauzy-webapp: + runs-on: buildjet-8vcpu-ubuntu-2204 + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Build and push + uses: docker/build-push-action@v4 + with: + context: . + file: ./.deploy/webapp/Dockerfile + load: true + tags: | + ghcr.io/ever-co/gauzy-webapp-stage:latest + everco/gauzy-webapp-stage:latest + registry.digitalocean.com/ever/gauzy-webapp-stage:latest + ${{ secrets.CW_DOCKER_REGISTRY }}/ever-co/gauzy-webapp-stage:latest + cache-from: type=registry,ref=everco/gauzy-webapp-stage:latest + cache-to: type=inline + build-args: | + NODE_ENV=development + + - name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Push to Docker Hub Registry + run: | + docker push everco/gauzy-webapp-stage:latest + + - name: Install doctl + uses: digitalocean/action-doctl@v2 + with: + token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} + + - name: Log in to DigitalOcean Container Registry with short-lived credentials + run: doctl registry login --expiry-seconds 3600 + + - name: Push to DigitalOcean Registry + run: | + docker push registry.digitalocean.com/ever/gauzy-webapp-stage:latest + + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GH_TOKEN }} + + - name: Push to Github Registry + run: | + docker push ghcr.io/ever-co/gauzy-webapp-stage:latest + + - name: Login to CW Container Registry + uses: docker/login-action@v2 + with: + registry: ${{ secrets.CW_DOCKER_REGISTRY }} + username: ${{ secrets.CW_DOCKER_USER }} + password: ${{ secrets.CW_DOCKER_USER_PASSWORD }} + + - name: Push to CW Registry + run: | + docker push ${{ secrets.CW_DOCKER_REGISTRY }}/ever-co/gauzy-webapp-stage:latest