Skip to content

fix: Lint fix.

fix: Lint fix. #28

Workflow file for this run

name: Build
on:
push:
tags:
- 'v*'
jobs:
backend-lint:
name: Backend Lint
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: false
- name: Lint
uses: golangci/golangci-lint-action@v6
frontend-lint:
name: Frontend Lint
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Setup Node.js for use with actions
uses: actions/setup-node@v4
with:
node-version-file: frontend/.nvmrc
cache: npm
cache-dependency-path: frontend/package-lock.json
- name: Install dependencies
run: npm --prefix frontend install --prefer-offline --no-audit
- run: npm --prefix frontend run lint
build-backend:
name: Build Backend Image
runs-on: ubuntu-24.04
outputs:
digest: ${{ steps.docker_build.outputs.digest }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/Sphincz/sphincz-website
tags: |
type=raw,priority=1000,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/v') }}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=ref,event=branch
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Build and Push
id: docker_build
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile.prod
pull: true
push: ${{ github.ref_name == 'main' || startsWith(github.ref, 'refs/tags/v') }}
platforms: linux/amd64
tags: ${{ steps.meta.outputs.tags }}
target: backend
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-frontend:
name: Build Frontend
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version-file: frontend/.nvmrc
cache: npm
cache-dependency-path: frontend/package-lock.json
- name: Install dependencies
run: npm --prefix=frontend install --prefer-offline --no-audit
- name: Build
env:
VITE_API_ADDRESS: http://localhost:8181
VITE_PLAUSIBLE_HOST: http://localhost:8001
VITE_TURNSTILE_KEY: ${{ secrets.VITE_TURNSTILE_KEY }}
run: npm --prefix=frontend run build
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: dist
path: frontend/dist
release:
name: Release
runs-on: ubuntu-24.04
needs: [backend-lint, frontend-lint, build-backend, build-frontend]
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Release
uses: softprops/action-gh-release@v2