Add Gitea workflow
This commit is contained in:
parent
c24691e2ef
commit
999ca023e8
30
.gitea/workflows/deploy.yml
Normal file
30
.gitea/workflows/deploy.yml
Normal 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
18
Dockerfile
Normal 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
9
docker-compose.yml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
version: '3'
|
||||
|
||||
services:
|
||||
web:
|
||||
image: your-docker-image-name
|
||||
ports:
|
||||
- '8086:80'
|
||||
volumes:
|
||||
- ./dist:/usr/share/nginx/html:ro
|
||||
Loading…
Reference in a new issue