forked from TurboWarp/scratch-gui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.woodpecker.yaml
More file actions
63 lines (59 loc) · 2.7 KB
/
.woodpecker.yaml
File metadata and controls
63 lines (59 loc) · 2.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Based on https://codeberg.org/Codeberg-CI/examples/src/branch/main/NodeJS/.woodpecker.yaml
# and https://codeberg.org/LibreKitten/LibreKitten-gui/src/branch/develop/.woodpecker.yaml
# The original license:
# Copyright (C) YEAR by AUTHOR EMAIL
# Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
# https://cjerrington.codeberg.page/eleventy-base-blog-site/blog/codebergpagesbuild/
#
# This file would typically be .woodpecker.yml in the root of your repository.
#
#
# SECRETS
# https://woodpecker-ci.org/docs/usage/secrets
# CBTOKEN needs a codeberg access token as secret in woodpecker config
# CBMAIL with email address for git config
# SOURCEREPO must be replaced with the source repo
# DESTREPO must be replaced with the target codeberg pages repo
# CBUSERNAME must be replaced with the user/org
#
#
# We also assume a domains file in the source repo that gets copied to
# .domains in the target repo so codeberg pages works for custom domains
#
steps:
- name: build
when:
event: [push, manual, cron]
# Use the official jekyll build container
image: node
environment:
# secrets must be set in Woodpecker configuration
CBTOKEN:
from_secret: cbtoken
commands:
# Avoid permission denied errors
- chmod -R a+w .
# Set up git in a working way
- git config --global --add safe.directory /woodpecker/src/codeberg.org/ampmod/scratch-gui/build
- git config --global user.email "no@thankyou.com"
- git config --global user.name "CI Builder"
# clone and move the target repo
- git clone -b pages https://codeberg.org/ampmod/pages.git build
- chmod -R a+w build
- cd build
# Prepare for push
- git remote set-url origin https://$CBTOKEN@codeberg.org/ampmod/pages.git
- git rm -rf ./*
- git commit -m 'Woodpecker CI - Clean up.'
- cd ..
# Run 11ty build stage
- npm ci
- npm run ci-build
# Only needed for custom domains
# - cp domains build/.domains
# Push to target
- cd build
- git add --all
- git commit -m "Woodpecker CI Build at $( env TZ=America/Chicago date +'%Y-%m-%d %X %Z' )"
- git push -u origin pages