setup pipeline

This commit is contained in:
2026-03-16 00:31:46 -04:00
parent 7ed88ae609
commit d392180cf6
2 changed files with 14 additions and 26 deletions

View File

@@ -1,32 +1,17 @@
name: Build
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
jobs: jobs:
build: build-and-deploy:
runs-on: ubuntu-latest runs-on: ubuntu-latest # Runner must have Docker socket mounted
steps: steps:
- name: Checkout - uses: actions/checkout@v4
uses: actions/checkout@v4 - uses: actions/setup-node@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with: with:
node-version: '20' node-version: '20'
cache: 'npm' cache: 'npm'
- run: npm ci && npm run build
- name: Install dependencies - name: Build and run container
run: npm ci run: |
docker build -t cachetdeco:latest .
- name: Build docker stop cachetdeco 2>/dev/null || true
run: npm run build docker rm cachetdeco 2>/dev/null || true
docker run -d --name cachetdeco -p 30001:80 --restart unless-stopped cachetdeco:latest
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: dist
path: dist/

3
Dockerfile Normal file
View File

@@ -0,0 +1,3 @@
FROM nginx:alpine
COPY dist/ /usr/share/nginx/html/
EXPOSE 80