Switch back to old-styled CI/CD configuration

No more Nix :(
This commit is contained in:
Hoang Nguyen 2023-11-25 00:00:00 +07:00
parent 8008d1c798
commit 73e5c859f3
Signed by: folliehiyuki
GPG Key ID: B0567C20730E9B11
1 changed files with 26 additions and 8 deletions

View File

@ -1,19 +1,37 @@
---
default:
interruptible: true
tags:
- docker
- linux
stages:
- build
- deploy
workflow:
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
build:site:
stage: build
image: alpine:edge
script:
- echo "https://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories
- apk add --no-cache hugo dart-sass
- hugo --gc --panicOnWarning
artifacts:
expire_in: 1 hour
paths:
- public/
deploy:cloudflare_pages:
stage: deploy
image: nixos/nix:2.18.1
variables:
NIX_CONFIG: experimental-features = nix-command flakes
script:
- nix build .
- nix run .#publish
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
image: node:21-alpine
script: |
npx wrangler pages deploy \
--project-name=folliehiyuki \
--branch="$CI_COMMIT_REF_NAME" \
public/
dependencies:
- build:site