63 lines
1.4 KiB
YAML
63 lines
1.4 KiB
YAML
name: Build & deploy
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
tags: ['v*']
|
|
pull_request:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: ${{ gitea.workflow }}-${{ gitea.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
website:
|
|
name: Build & deploy website
|
|
runs-on: docker
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v7
|
|
with:
|
|
node-version-file: .nvmrc
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
npm ci
|
|
npm --prefix shared ci
|
|
npm --prefix frontend ci
|
|
npm --prefix backend ci
|
|
|
|
- name: Build (shared -> frontend -> backend)
|
|
run: npm run build
|
|
|
|
- name: Test
|
|
run: npm test
|
|
|
|
- name: Lint
|
|
run: npm run lint:check
|
|
|
|
- name: Deploy to host pages mount
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
uses: http://forgejo:3000/andras/ci-actions/deploy-pages@main
|
|
with:
|
|
source: frontend/dist
|
|
target: doppler
|
|
|
|
server-image:
|
|
name: Build & publish server image
|
|
runs-on: docker
|
|
if: github.event_name != 'pull_request'
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Build and publish server image
|
|
uses: http://forgejo:3000/andras/ci-actions/docker-publish@main
|
|
with:
|
|
context: .
|
|
image-suffix: -server
|
|
token: ${{ secrets.FORGEJO_PACKAGE_TOKEN }}
|