Skip to content

Commit

Permalink
CI ready
Browse files Browse the repository at this point in the history
  • Loading branch information
KinanLak committed Oct 21, 2024
1 parent 5f06dd4 commit 8577609
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 3 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Build and push Docker image
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3.6.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2.9.1
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: kinanlak/spotipack:latest
platforms: linux/arm64
cache-from: type=registry,ref=kinanlak/spotipack:buildcache
cache-to: type=registry,ref=kinanlak/spotipack:buildcache,mode=max
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM node:lts-alpine

WORKDIR /app

COPY package*.json ./
RUN npm ci

COPY . .
RUN npm run build

FROM nginx:alpine

COPY --from=build /app/dist /usr/share/nginx/html

EXPOSE 80
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "webpack serve --open --config webpack.dev.js",
"build": "webpack --config webpack.prod.js",
"predeploy": "npm run build",
"deploy": "gh-pages -d dist"
"build": "webpack --config webpack.prod.js"
},
"repository": {
"type": "git",
Expand Down

0 comments on commit 8577609

Please sign in to comment.