Skip to content

Commit

Permalink
feat(ci): build image
Browse files Browse the repository at this point in the history
  • Loading branch information
ImSoZRious committed Oct 4, 2023
1 parent 2ed3fcd commit 68f93fc
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.DS_Store
node_modules
dist
33 changes: 33 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: 'Build static sites image'

on:
push:
branches:
- main

jobs:
build_image:
name: Build docker image
runs-on:
- ubuntu-latest
permissions:
content: write
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Login to the Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build image
uses: docker/build-push-action@v5
with:
context: .
push: true
cache-from: type=gha
cache-to: type=gha,mode=max

9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM node:lts AS build
WORKDIR /app
COPY . .
RUN npm i
RUN npm run build

FROM httpd:2.4-alpine AS runtime
COPY --from=build /app/dist /usr/local/apache2/htdocs/
EXPOSE 80

0 comments on commit 68f93fc

Please sign in to comment.