Skip to content

Commit

Permalink
Merge pull request #5 from Morb0/deploy
Browse files Browse the repository at this point in the history
Add docker deploy workflow
  • Loading branch information
juliangiebel authored Sep 28, 2023
2 parents 9c99779 + 75ffda0 commit d8ac7ac
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Deploy

on:
workflow_dispatch:
push:
branches: [ "main" ]

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

jobs:
deploy-container:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Docker Login
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- uses: actions/checkout@v4

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest
type=raw,value=${{steps.get-version.outputs.version}}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM node:18-alpine as build

WORKDIR /app

ENV NODE_ENV production

COPY . .
RUN npm install vite -g
RUN npm install
RUN npm run build

ENTRYPOINT ["npm", "run", "preview", "--", "--host"]

0 comments on commit d8ac7ac

Please sign in to comment.