gist:5f3f482c38ed9ab59626cc19c6bbbada

1 min read Original article ↗
Why not choose reverse logic?
Keep your source code on forgejo instance
self hosted on vps and mirror it on GitHub.
And then trigger builds on GH and pull when an image is ready
back to your host - "dead simple ci" may help with that.
Check it out - deadsimpleci.sparrowhub.io/doc/README
---
On self hosted forgejo side, dsci pipeline
one just needs to run this code the loop
till it succeeds:
gh api repos/{owner}/{repo}/actions/artifacts \
--jq ".artifacts[] | select(.workflow_run.head_sha == \"21e6188608352ac2ed8e2d4c65e11ae2dbe20291\")"
Pros:
- Your VPS instance is not exposed ssh publicly
- You still use free gh cycles to build heavy things
- Your internal stuff is kept privately,
you don’t need to add any ssh keys, secrets to your gh account,
as in that case you just pull artifacts from public gh api
---
Prototype solution, using dsci:
Pipeline (jobs.yaml), pay attention
localhost modifier:
global:
localhost: true
jobs:
-
id: deploy
path: .
Job definition (task.bash):
commit=$(config DSCI_COMMIT)
while true
do
if gh api repos/{owner}/{repo}/actions/artifacts
--jq ".artifacts[] | select(.workflow_run.head_sha == $commit); then
# do something with artifact
break
else
sleep 5
fi
done
---
That is it