From 0e45d12d12f78154b6a6eefae6fc2ee83cbddf84 Mon Sep 17 00:00:00 2001
From: Anthony Wang
Date: Aug 30 2023 19:37:38 +0000
Subject: Rewrite .woodpecker.yml to use Alpine and pipx (#206)
The current CI pipeline was a workaround for Codeberg-CI/feedback#117 and is currently broken. This PR makes it use Alpine and pipx instead which should be more reliable.
Reviewed-on: https://codeberg.org/ForgeFed/ForgeFed/pulls/206
Co-authored-by: Anthony Wang
Co-committed-by: Anthony Wang
---
diff --git a/.woodpecker.yml b/.woodpecker.yml
new file mode 100644
index 0000000..325086b
--- /dev/null
+++ b/.woodpecker.yml
@@ -0,0 +1,22 @@
+steps:
+ deploy-dry:
+ image: alpine:edge
+ commands:
+ - apk add bash git pipx zola
+ - pipx run bikeshed update
+ - bash build.sh
+ - git diff
+ when:
+ event: ["push", "pull_request"]
+
+ deploy:
+ image: alpine:edge
+ commands:
+ - apk add bash git pipx zola
+ - pipx run bikeshed update
+ - bash build.sh
+ - bash deploy.sh
+ secrets: ["bot_token"]
+ when:
+ event: ["push", "tag"]
+ branch: ${CI_REPO_DEFAULT_BRANCH}
diff --git a/.woodpecker/deploy.yml b/.woodpecker/deploy.yml
deleted file mode 100644
index 0008242..0000000
--- a/.woodpecker/deploy.yml
+++ /dev/null
@@ -1,26 +0,0 @@
-pipeline:
- deploy-dry:
- image: archlinux
- commands:
- - pacman -Sy
- - pacman -S git python-pip python-setuptools zola --noconfirm
- - pip install bikeshed
- - python -m bikeshed update
- - bash build.sh
- - git diff
- when:
- event: ["push", "pull_request"]
-
- deploy:
- image: archlinux
- commands:
- - pacman -Sy
- - pacman -S git python-pip python-setuptools zola --noconfirm
- - pip install bikeshed
- - python -m bikeshed update
- - bash build.sh
- - bash deploy.sh
- secrets: ["bot_token"]
- when:
- event: ["push", "tag"]
- branch: ${CI_REPO_DEFAULT_BRANCH}
diff --git a/build.sh b/build.sh
index 5d47669..c7010bc 100755
--- a/build.sh
+++ b/build.sh
@@ -13,7 +13,7 @@ zola build
cp context.jsonld public/ns
mkdir -p public/spec
-bikeshed spec "spec.bs" "public/spec/index.html" \
+pipx run bikeshed spec "spec.bs" "public/spec/index.html" \
--md-text-macro="GITBRANCH $git_branch" \
--md-text-macro="GITCOMMIT $git_commit_id" \
--md-text-macro="GITSHORT $git_commit_id_short"