Forgejo Builder: Initial Commit
This commit is contained in:
commit
f170552ef5
|
|
@ -0,0 +1,52 @@
|
||||||
|
name: Build Forgejo
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '0 0 * * 0'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
docker-build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 20
|
||||||
|
permissions:
|
||||||
|
packages: write
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- name: Clone forgejo
|
||||||
|
run: git clone --depth=1 --single-branch https://codeberg.org/forgejo/forgejo.git .
|
||||||
|
|
||||||
|
- name: Login to Docker Hub
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Login to GitHub Container Registry
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.repository_owner }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build and push forgejo
|
||||||
|
uses: docker/build-push-action@v4
|
||||||
|
continue-on-error: true
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
ghcr.io/boxinaclosedbox/forgejo:latest
|
||||||
|
boxinaclosedbox/forgejo:latest
|
||||||
|
file: Dockerfile
|
||||||
|
|
||||||
|
- name: Build and push forgejo rootless
|
||||||
|
uses: docker/build-push-action@v4
|
||||||
|
continue-on-error: true
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
ghcr.io/boxinaclosedbox/forgejo:latest-rootless
|
||||||
|
boxinaclosedbox/forgejo:latest-rootless
|
||||||
|
file: Dockerfile.rootless
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
name: Keep Actions Alive
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '2 1 2 * *'
|
||||||
|
jobs:
|
||||||
|
KeepAlive:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
steps:
|
||||||
|
- name: Checkouts
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Commit to 'keepalive' branch
|
||||||
|
run: |
|
||||||
|
REPO_URL=$(git config --get remote.origin.url) ; REPO_BASE=$(echo "${REPO_URL}" |sed 's/.*\/\///g') ; USERNAME=$(echo $REPO_BASE |sed 's/\/.*//g') ; GITHUB_TOKEN=${{secrets.GITHUB_TOKEN}}
|
||||||
|
if [ "${GITHUB_EMAIL}" = "" ]; then GITHUB_EMAIL=boxinaclosedbox@gmail.com ; fi ; git config --global user.email "${GITHUB_EMAIL}"
|
||||||
|
if [ "${GITHUB_USERNAME}" = "" ]; then GITHUB_USERNAME="Box In A Box" ; fi ; git config --global user.name "${GITHUB_USERNAME}"
|
||||||
|
rm -rf * .git .github
|
||||||
|
echo "${RANDOM}${RANDOM}${RANDOM}${RANDOM}${RANDOM}" >> Random.txt
|
||||||
|
git init ; git add Random.txt
|
||||||
|
git commit -m "KeepALive As of \"$(date)\""
|
||||||
|
git remote add origin https://"{USERNAME}":"${GITHUB_TOKEN}"@"${REPO_BASE}"
|
||||||
|
git checkout -b keepalive
|
||||||
|
git push --set-upstream origin keepalive -f
|
||||||
Loading…
Reference in New Issue