69 lines
2 KiB
YAML
69 lines
2 KiB
YAML
name: Deploy Pages
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
workflow_dispatch:
|
|
schedule:
|
|
- cron: '43 16 * * *'
|
|
|
|
concurrency:
|
|
group: deploy-${{ forgejo.ref }}
|
|
cancel-in-progress: false
|
|
|
|
env:
|
|
PAGE_SERVER: pgs.xlion.dev
|
|
|
|
jobs:
|
|
deploy:
|
|
if: ${{ forgejo.event_name != 'pull_request' || forgejo.event.pull_request.head.repo.full_name == forgejo.repository }}
|
|
runs-on: ha
|
|
timeout-minutes: 35
|
|
|
|
steps:
|
|
- name: Download all sources
|
|
shell: bash
|
|
run: |
|
|
mkdir -p public tmp
|
|
set -euo pipefail
|
|
urls=(
|
|
"https://cdn.jsdelivr.net/gh/hagezi/dns-blocklists@latest/ips/tif.txt"
|
|
"https://raw.githubusercontent.com/stamparm/ipsum/refs/heads/master/levels/3.txt"
|
|
"https://lists.blocklist.de/lists/ssh.txt"
|
|
"https://lists.blocklist.de/lists/bots.txt"
|
|
"https://lists.blocklist.de/lists/strongips.txt"
|
|
"https://lists.blocklist.de/lists/bruteforcelogin.txt"
|
|
"https://blocklist.greensnow.co/greensnow.txt"
|
|
)
|
|
|
|
wget --tries=3 --timeout=30 -P tmp/ "${urls[@]}"
|
|
|
|
- name: Show the size of the tmp
|
|
run: du -sh tmp/
|
|
|
|
- name: Show the content of the tmp
|
|
run: ls -al tmp/
|
|
|
|
- name: Create target, main-v4
|
|
run: cat tmp/* >> public/main-v4.txt
|
|
|
|
- name: Show the size of the public
|
|
run: du -sh public/
|
|
|
|
- name: Show the content of the public
|
|
run: ls -al public/
|
|
|
|
- name: Resolve repository name
|
|
id: repository
|
|
run: |
|
|
echo "name=${FORGEJO_REPOSITORY#*/}" >> "$FORGEJO_OUTPUT"
|
|
|
|
- name: Deploy production
|
|
if: ${{ forgejo.event_name != 'pull_request' }}
|
|
uses: https://codeberg.org/git-pages/action@2b24bbb7ff943d3c8fe1df91326adec66daea6dd # v2.2.0
|
|
with:
|
|
site: https://${{ forgejo.repository_owner }}.${{ env.PAGE_SERVER }}/${{ steps.repository.outputs.name }}/
|
|
token: ${{ forgejo.token }}
|
|
source: public
|