diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 727d9c0475..deb4de856e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -40,9 +40,10 @@ jobs: username: ${{ env.BOT_USERNAME }} password: '${{ secrets.BOT_TOKEN }}' - name: CI tests, image build and push tag for main or branch - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: push: true + context: . tags: | ${{ env.CACHE_REGISTRY }}/${{ env.CACHE_REPO }}:${{ env.TAG }} diff --git a/.github/workflows/otomi-tools-build-push.yaml b/.github/workflows/otomi-tools-build-push.yaml index 8117664d8d..ca37d92074 100644 --- a/.github/workflows/otomi-tools-build-push.yaml +++ b/.github/workflows/otomi-tools-build-push.yaml @@ -80,9 +80,10 @@ jobs: password: ${{ secrets.DOCKERHUB_LINODEBOT_TOKEN }} - name: image build and push tag for branch if: ${{ env.NEW_VERSION != null }} - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: push: true + context: './tools' platforms: linux/amd64 file: tools/Dockerfile tags: | diff --git a/Dockerfile b/Dockerfile index 16cb0c14ac..f4ed948ea4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM linode/apl-tools:v2.8.2 as ci +FROM linode/apl-tools:v2.8.2 AS ci ENV APP_HOME=/home/app/stack @@ -21,12 +21,12 @@ RUN npm ci --ignore-scripts && npm run compile RUN if [ "$SKIP_TESTS" = 'false' ]; then ln -s $APP_HOME/tests/fixtures env && npm test && rm env; fi # --------------- Cleanup -FROM ci as clean +FROM ci AS clean # below command removes the packages specified in devDependencies and set NODE_ENV to production RUN npm prune --production -FROM linode/apl-tools:v2.8.2 as prod +FROM linode/apl-tools:v2.8.2 AS prod ENV APP_HOME=/home/app/stack ENV ENV_DIR=/home/app/stack/env ENV VERBOSITY='0' diff --git a/tools/Dockerfile b/tools/Dockerfile index 6ce441609c..0957720288 100644 --- a/tools/Dockerfile +++ b/tools/Dockerfile @@ -1,5 +1,5 @@ # syntax=docker/dockerfile:1.6 -FROM ubuntu:20.04 as builder +FROM ubuntu:20.04 AS builder ARG DEBIAN_FRONTEND=noninteractive ARG TARGETARCH @@ -127,7 +127,7 @@ RUN set -uex && \ apt-get install -y nodejs && \ npm install -g ajv-cli@v3.3.0 json-dereference-cli@0.1.2 zx -FROM ubuntu:20.04 as final +FROM ubuntu:20.04 AS final RUN mkdir -p /home/app RUN groupadd -r app &&\