From 3b9a80770e9d5925ae0fefedb224eb5b1ae58be6 Mon Sep 17 00:00:00 2001 From: Swarup Karavadi Date: Fri, 7 Jun 2024 15:24:30 +0200 Subject: [PATCH] chore: fixing issues with CI config related to docker (#9) * chore: removed freezelockfile option from bun install command * chore: updated action versions * chore: put in the right github secret variable --- .github/workflows/release.yml | 10 +++++----- Dockerfile | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8b942a9..00ad142 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,7 +1,7 @@ # name: Create and publish a Docker image -# Configures this workflow to run every time a change is pushed to the branch called `release`. +# Configures this workflow to run every time a change is pushed to the main branch. on: push: branches: ['main'] @@ -27,15 +27,15 @@ jobs: uses: actions/checkout@v4 # Uses the `docker/login-action` action to log in to the Container registry registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here. - name: Log in to the Container registry - uses: docker/login-action@v3 + uses: docker/login-action@v3.2.0 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + password: ${{ secrets.GH_TOKEN }} # This step uses [docker/metadata-action](https://github.com/docker/metadata-action#about) to extract tags and labels that will be applied to the specified image. The `id` "meta" allows the output of this step to be referenced in a subsequent step. The `images` value provides the base name for the tags and labels. - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@v3 + uses: docker/metadata-action@v5.5.1 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} # This step uses the `docker/build-push-action` action to build the image, based on your repository's `Dockerfile`. If the build succeeds, it pushes the image to GitHub Packages. @@ -43,7 +43,7 @@ jobs: # It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step. - name: Build and push Docker image id: push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: context: . push: true diff --git a/Dockerfile b/Dockerfile index 0bd6f3f..f6d4ee3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,12 +8,12 @@ WORKDIR /usr/src/app FROM base AS install RUN mkdir -p /temp/dev COPY package.json bun.lockb /temp/dev/ -RUN cd /temp/dev && bun install --frozen-lockfile +RUN cd /temp/dev && bun install # install with --production (exclude devDependencies) RUN mkdir -p /temp/prod COPY package.json bun.lockb /temp/prod/ -RUN cd /temp/prod && bun install --frozen-lockfile --production +RUN cd /temp/prod && bun install --production # copy node_modules from temp directory # then copy all (non-ignored) project files into the image