Skip to content

Commit

Permalink
Adding ci.yaml and updated dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
larsha committed Mar 27, 2024
1 parent 65a6ed2 commit 5528d0b
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 2 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: ci

on:
push:
branches:
- master
pull_request:

jobs:
web:
if: ${{ github.event_name == 'push' }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Login to DockerHub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push Docker image
id: docker_build
uses: docker/build-push-action@v2
with:
platforms: linux/amd64
context: .
file: ./Dockerfile
push: true
tags: |
sthlmio/web:1.0.${{ github.run_number }}
sthlmio/web:${{ github.sha }}
sthlmio/web:latest
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18.13-alpine AS builder
FROM node:20.12-alpine AS builder

USER node

Expand All @@ -16,7 +16,7 @@ COPY --chown=node:node . /home/node/web

RUN npm run export

FROM nginx:1.23-alpine
FROM nginx:1.24-alpine
COPY --from=builder /home/node/web/out /var/www
COPY nginx.conf /etc/nginx/nginx.conf

Expand Down

0 comments on commit 5528d0b

Please sign in to comment.