Skip to content

Commit

Permalink
Merge branch 'main' of github.com:redbrick/11ty-website
Browse files Browse the repository at this point in the history
  • Loading branch information
JedHazaymeh committed Jan 31, 2024
2 parents 0448f04 + 660ec5b commit 68f3007
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 6 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Build & Publish Docker Image

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

on:
push:
branches: [ "main" ]

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v4

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=sha,format=long
type=match,pattern=main
type=raw,value=latest,enable={{is_default_branch}}
flavor: |
latest=auto
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
10 changes: 4 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,16 @@ FROM node:18.19.0-alpine AS build

RUN apk update && apk add git

USER node
COPY . /app/

WORKDIR /app
COPY ./package.json ./
RUN yarn config set network-timeout 600000 -g

RUN yarn && yarn cache clean
RUN yarn

COPY . .
RUN yarn build

FROM nginx:1.24.0-alpine AS production

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

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

0 comments on commit 68f3007

Please sign in to comment.