Skip to content

Commit

Permalink
Separate deploy images
Browse files Browse the repository at this point in the history
  • Loading branch information
maciekiwaniuk committed Nov 9, 2024
1 parent be765ea commit 26b933d
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 5 deletions.
19 changes: 14 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ env:
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
build-and-push-images:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
permissions:
contents: read
packages: write
Expand All @@ -27,10 +27,19 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Build and Push
- name: Build and Push Images
run: |
docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/portfolio:latest .
docker push ${{ secrets.DOCKERHUB_USERNAME }}/portfolio:latest
cd docker/frontend
docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/portfolio-frontend:latest .
docker push ${{ secrets.DOCKERHUB_USERNAME }}/portfolio-frontend:latest
ls
cd ../../docker/nginx
docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/portfolio-nginx:latest .
docker push ${{ secrets.DOCKERHUB_USERNAME }}/portfolio-nginx:latest
- name: Build and Push Nginx Image
run: |
deploy:
runs-on: ubuntu-latest
Expand Down
13 changes: 13 additions & 0 deletions docker/frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:23-alpine AS build

WORKDIR /var/www/html

COPY package*.json ./

RUN npm install --production

COPY . .

RUN npx nuxi build

CMD ["node", ".output/server/index.mjs"]
7 changes: 7 additions & 0 deletions docker/nginx/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM nginx:1.27.2-alpine

COPY ./docker/nginx/prod/nginx.conf /etc/nginx/nginx.conf

EXPOSE 80

CMD ["nginx", "-g", "daemon off;"]

0 comments on commit 26b933d

Please sign in to comment.