feat: experimental CI pipeline

This commit is contained in:
Ashhhleyyy 2022-07-25 19:55:13 +01:00
parent 36cf7171a8
commit e98cccc656
Signed by: ash
GPG key ID: 83B789081A0878FB
3 changed files with 52 additions and 0 deletions

36
.drone.yml Normal file
View file

@ -0,0 +1,36 @@
kind: pipeline
type: docker
name: Build
platform:
os: linux
arch: arm64
steps:
- name: Install dependencies
image: node-pnpm:16-alpine
commands:
- pnpm install --frozen-lockfile
- name: Check formatting
image: node-pnpm:16-alpine
commands:
- pnpm format:check
- name: Lint code
image: node-pnpm:16-alpine
commands:
- pnpm lint
- name: Build site
image: node-pnpm:16-alpine
commands:
- pnpm build
- name: Create bundle
image: alpine
commands:
- scripts/build-release.sh
- name: Push bundle
image: alpine
commands:
- apk add curl ca-certificates
- 'curl --fail --upload-file @comicbox.tar.gz --user robot:$ROBOT_TOKEN https://git.ashhhleyyy.dev/api/packages/robot/generic/comicbox/0.1.0+git.${DRONE_COMMIT_SHA:0:8}/comicbox.tar.gz'
trigger:
event: [push]
branch: [main]

View file

@ -5,6 +5,7 @@ const nextConfig = {
images: { images: {
domains: ['img.comicfury.com'], domains: ['img.comicfury.com'],
}, },
output: 'standalone',
}; };
module.exports = nextConfig; module.exports = nextConfig;

15
scripts/build-release.sh Executable file
View file

@ -0,0 +1,15 @@
#!/usr/bin/env sh
set -e -u -o pipefail
echo Building production TAR...
mkdir -p comicbox/
mkdir -p comicbox/.next/
cp -r .next/standalone/* comicbox/
cp -r .next/static/ comicbox/.next/
cp next.config.js comicbox/
cp -r public/ comicbox/
tar -cvzf comicbox.tar.gz comicbox/