Files
website/.gitea/workflows/build.yml
matt a806dd8560
All checks were successful
build-website / build (push) Successful in 1m45s
Publish Docker image to Gitea registry
2025-09-18 23:59:45 +02:00

53 lines
1.3 KiB
YAML

name: build-website
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node 20
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: npm ci
working-directory: apps/website
- name: Nuxt prepare
run: npm run postinstall
working-directory: apps/website
- name: Build Nuxt
run: npm run build
working-directory: apps/website
- name: Install Docker CLI
run: |
apt-get update
apt-get install -y docker.io
- name: Log in to registry
run: echo "${{ secrets.REGISTRY_TOKEN }}" | docker login code.harborsmith.co -u matt --password-stdin
- name: Build and push image
env:
IMAGE: code.harborsmith.co/matt/website
run: |
docker build -f apps/website/Dockerfile.prod -t $IMAGE:${{ github.sha }} apps/website
docker push $IMAGE:${{ github.sha }}
docker tag $IMAGE:${{ github.sha }} $IMAGE:latest
docker push $IMAGE:latest
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: website-dist
path: apps/website/.output/public