Add Gitea workflow

This commit is contained in:
TheThomaas 2023-05-24 20:12:43 +02:00
parent c24691e2ef
commit 999ca023e8
3 changed files with 57 additions and 0 deletions

View file

@ -0,0 +1,30 @@
name: Deploy to Docker Container
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install dependencies and build
run: |
npm ci
npm run production
- name: Build Docker image
run: docker build -t 11ty-workflow-example --build-arg SITE_DIRECTORY=dist .
- name: Set up Docker Compose
uses: docker/compose-action@v1
with:
compose-file: docker-compose.yml
- name: Start Docker Compose services
run: docker-compose up -d

18
Dockerfile Normal file
View file

@ -0,0 +1,18 @@
# Use a lightweight Node.js runtime as the base image for the final stage
FROM node:14-alpine
# Set the working directory in the container
WORKDIR /app
# Copy the compiled site from the build context into the image
ARG SITE_DIRECTORY
COPY $SITE_DIRECTORY ./dist
# Expose the port your application listens on (if applicable)
# EXPOSE 3000
# Define any additional configuration or runtime commands as needed
# ...
# Example: Start a simple HTTP server to serve the static files
CMD ["npx", "http-server", "dist"]

9
docker-compose.yml Normal file
View file

@ -0,0 +1,9 @@
version: '3'
services:
web:
image: your-docker-image-name
ports:
- '8086:80'
volumes:
- ./dist:/usr/share/nginx/html:ro