Skip to content

Commit

Permalink
try to deploy base image
Browse files Browse the repository at this point in the history
  • Loading branch information
k2xl committed Jan 28, 2024
1 parent f121ef0 commit 74948ed
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,19 @@ jobs:
GITHUB_RUN_NUMBER: ${{ github.run_number }}
run: echo "::set-output name=version::$(date +'%Y-%m-%d').$GITHUB_RUN_NUMBER"

- name: Build and Push Base Image
if: github.ref == 'refs/heads/main'
uses: docker/build-push-action@v4
with:
context: .
file: Dockerfile
load: false
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ${{ secrets.DOCKERHUB_USERNAME }}/thinky_app_base:latest
target: base
push: true

- name: Build container image and push to Docker Hub
uses: docker/build-push-action@v4
with:
Expand Down
9 changes: 7 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM node:20
# First Stage: Setup the base environment
FROM node:20 AS base

WORKDIR /thinky_app

ENV NEXT_TELEMETRY_DISABLED=1
Expand All @@ -21,7 +23,10 @@ COPY --chown=node:node package*.json ./

RUN npm install --platform=linux --arch=x64 sharp
RUN npm install --platform=linuxmusl
#RUN chown -R node:node node_modules/

# HERE IS WHERE WE WANT TO END WHERE THE BASE IMAGE IS

FROM base AS final

COPY --chown=node:node . .

Expand Down

0 comments on commit 74948ed

Please sign in to comment.