54 lines
1.3 KiB
YAML
54 lines
1.3 KiB
YAML
name: Next.js App CI
|
|
|
|
on:
|
|
push:
|
|
branches: [ "main" ]
|
|
|
|
jobs:
|
|
docker:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Login to Gitea Package Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{vars.LOCAL_REGISTRY}}
|
|
username: ${{ VARS.USER }}
|
|
password: ${{ secrets.TOKEN }}
|
|
|
|
- name: Generate Static Image Assets
|
|
uses: add-actions/run-in-container@v1
|
|
with:
|
|
image: archlinux:latest
|
|
run: |
|
|
pacman -Syu --noconfirm imagemagick webp ghostscript
|
|
chmod +x ./scripts/*.sh
|
|
bash ./scripts/first_page_image.sh
|
|
bash ./scripts/generate_webp.sh
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20.x'
|
|
cache: 'npm'
|
|
|
|
- name: Install Node.js Dependencies
|
|
run: npm ci
|
|
|
|
- name: Build Next.js App
|
|
run: npm run build
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
platforms: linux/amd64
|
|
push: true
|
|
tags: |
|
|
${{ vars.LOCAL_REGISTRY }}/${{ gitea.repository_owner }}/website:latest
|
|
${{ vars.LOCAL_REGISTRY }}/${{ gitea.repository_owner }}/website:${{ gitea.sha }} |