mirror of
https://github.com/hzrd149/nostrudel.git
synced 2025-03-26 17:52:18 +01:00
add docker image
This commit is contained in:
parent
52d567c59b
commit
1afbe8562b
5
.changeset/yellow-brooms-sell.md
Normal file
5
.changeset/yellow-brooms-sell.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"nostrudel": minor
|
||||
---
|
||||
|
||||
Add docker image
|
41
.github/workflows/docker-image.yml
vendored
Normal file
41
.github/workflows/docker-image.yml
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
name: Create and publish a Docker image
|
||||
# copied from https://blog.pradumnasaraf.dev/publish-image-on-ghcr
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ["master"]
|
||||
|
||||
env:
|
||||
REGISTRY: ghcr.io
|
||||
IMAGE_NAME: ${{ github.repository }}
|
||||
|
||||
jobs:
|
||||
build-and-push-image:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Log in to the Container registry
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
id: meta
|
||||
uses: docker/metadata-action@v4
|
||||
with:
|
||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
9
dockerfile
Normal file
9
dockerfile
Normal file
@ -0,0 +1,9 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
FROM node:18
|
||||
WORKDIR /app
|
||||
COPY . /app/
|
||||
RUN yarn install && yarn build
|
||||
|
||||
FROM nginx:stable-alpine-slim
|
||||
EXPOSE 80
|
||||
COPY --from=0 /app/dist /usr/share/nginx/html
|
Loading…
x
Reference in New Issue
Block a user