diff --git a/.github/workflows/docker-build.yaml b/.github/workflows/docker-build.yaml index a05ce6df..16713f01 100644 --- a/.github/workflows/docker-build.yaml +++ b/.github/workflows/docker-build.yaml @@ -1,31 +1,20 @@ -name: Build app and push to GHCR +name: Build docker image and push to GHCR on: - release: - types: [published] + push: + branches: + - master + workflow_dispatch: jobs: - build-webapp: + build-www: runs-on: ubuntu-latest steps: - name: Checkout repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 - # Build the app using nodejs - - name: Use node js 22 - uses: actions/setup-node@v3 - with: - node-version: '22' - - name: Install dependencies - run: npm install - - name: Build for production - run: npm run build - - # Setup buildx in order to build for multiple platforms - # - name: Set up QEMU - # uses: docker/setup-qemu-action@v2 - # - name: Set up Docker Buildx - # uses: docker/setup-buildx-action@v2 + - name: Setup Cache + uses: actions/setup-node@v4 # Extract metadata for the docker image - name: Docker meta @@ -50,7 +39,7 @@ jobs: with: registry: ghcr.io username: ${{ github.repository_owner }} - password: ${{ secrets.CR_PAT }} + password: ${{ secrets.GH_TOKEN }} # Build the docker image now - name: Build and push uses: docker/build-push-action@v4 @@ -58,5 +47,5 @@ jobs: context: . push: true platforms: linux/amd64 - tags: ${{ steps.meta.outputs.tags }},ghcr.io/itswadesh/svelte-commerce:latest + tags: ${{ steps.meta.outputs.tags }},ghcr.io/itswadesh/svelte-commerce:1.0 labels: ${{ steps.meta.outputs.labels }} diff --git a/Dockerfile b/Dockerfile index 43996169..8f19b51f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,6 @@ # Use an official Node.js runtime as a parent image FROM node:22-alpine + LABEL author="Swadesh Behera" # Set the working directory inside the container @@ -9,7 +10,7 @@ WORKDIR /usr/src/app COPY package*.json ./ # Install dependencies -RUN npm install --force +RUN npm install # Copy the rest of your application's source code to the working directory COPY . . diff --git a/package.json b/package.json index 170549d9..bf119e4a 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,7 @@ "prettier-plugin-svelte": "^3.2.7", "shelljs": "0.8.5", "ssh2shell": "2.0.9", - "svelte": "^5.0.0-next.260", + "svelte": "^4.2.19", "svelte-confetti": "^2.1.2", "svelte-preprocess": "^6.0.3", "svelte-share-buttons-component": "2.0.0",