Compare commits

...

5 commits

Author SHA1 Message Date
Benoit Donneaux 04bb3d712b Rename Gitea to Forgejo
Some checks failed
Jekyll / jekyll (pull_request) Failing after 0s
Signed-off-by: Benoit Donneaux <benoit@leastauthority.com>
2025-08-13 18:16:20 +02:00
Benoit Donneaux 52382d65e3 Use the correct virtual hosts for prod
Signed-off-by: Benoit Donneaux <benoit@leastauthority.com>
2025-08-13 18:14:17 +02:00
Benoit Donneaux dcf1fbd4f6 Use the correct username to deploy on prod
Signed-off-by: Benoit Donneaux <benoit@leastauthority.com>
2025-08-13 18:13:05 +02:00
Benoit Donneaux 2457855851 Override the default git server url to use Forgejo
Signed-off-by: Benoit Donneaux <benoit@leastauthority.com>
2025-08-13 18:12:51 +02:00
Benoit Donneaux 7876d26d6f Explicitly use the pr-commenter-action from GH
Signed-off-by: Benoit Donneaux <benoit@leastauthority.com>
2025-08-13 18:12:30 +02:00
3 changed files with 20 additions and 17 deletions

View file

@ -8,8 +8,9 @@ on:
env: env:
_UID: 1000 _UID: 1000
_GID: 1000 _GID: 1000
WEB_DOMAIN: lafs.eval.latfa.net WEB_DOMAIN: tahoe-lafs.org
WEB_USER: www WEB_HOST: webforge.of.tahoe-lafs.org
WEB_USER: bot-www
WEB_DIR: /var/www WEB_DIR: /var/www
jobs: jobs:
jekyll: jekyll:
@ -18,6 +19,7 @@ jobs:
- name: Check out repository - name: Check out repository
id: checkout id: checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
github-server-url: 'https://forge.of.tahoe-lafs.org/'
- name: Change file ownership - name: Change file ownership
id: file_ownership id: file_ownership
run: | run: |
@ -56,16 +58,17 @@ jobs:
id: deploy_site id: deploy_site
run: | run: |
if [ "${{ gitea.ref }}" = 'refs/heads/main' ]; then if [ "${{ gitea.ref }}" = 'refs/heads/main' ]; then
WEB_ROOT="${WEB_DIR}/site" WEB_ROOT="${WEB_DIR}/live"
WEB_HOST="www.${WEB_DOMAIN}" WEB_VHOST="home.of.${WEB_DOMAIN}"
WEB_CONTEXT='/' WEB_CONTEXT='/'
else else
WEB_ROOT="${WEB_DIR}/preview" WEB_ROOT="${WEB_DIR}/preview"
WEB_HOST="preview.${WEB_DOMAIN}" WEB_VHOST="preview.of.${WEB_DOMAIN}"
WEB_CONTEXT='/${{ gitea.event.pull_request.number }}/' WEB_CONTEXT='/${{ gitea.event.pull_request.number }}/'
fi fi
# Save those variabes in the environment for the next steps # Save those variabes in the environment for the next steps
echo "WEB_HOST=${WEB_HOST}" >> $GITHUB_ENV echo "WEB_HOST=${WEB_HOST}" >> $GITHUB_ENV
echo "WEB_VHOST=${WEB_VHOST}" >> $GITHUB_ENV
echo "WEB_CONTEXT=${WEB_CONTEXT}" >> $GITHUB_ENV echo "WEB_CONTEXT=${WEB_CONTEXT}" >> $GITHUB_ENV
# Prepare ssh key # Prepare ssh key
echo "${{ secrets.WWW_DEPLOY_KEY }}" > ~/.ssh/id_ed25519 echo "${{ secrets.WWW_DEPLOY_KEY }}" > ~/.ssh/id_ed25519
@ -73,23 +76,23 @@ jobs:
# Synchronize the local and the remote site # Synchronize the local and the remote site
rsync -halvi --delete \ rsync -halvi --delete \
-e "ssh -a -x -o StrictHostKeyChecking=no" \ -e "ssh -a -x -o StrictHostKeyChecking=no" \
./_site/ "${WEB_USER}@${WEB_DOMAIN}:${WEB_ROOT}${WEB_CONTEXT}" ./_site/ "${WEB_USER}@${WEB_HOST}:${WEB_ROOT}${WEB_CONTEXT}"
- name: Comment pull request - name: Comment pull request
id: comment_pull_request id: comment_pull_request
if: ${{ always() && gitea.event_name == 'pull_request' }} if: ${{ always() && gitea.event_name == 'pull_request' }}
uses: exercism/pr-commenter-action@v1.5.1 uses: https://github.com/exercism/pr-commenter-action@v1.5.1
with: with:
template-variables: | template-variables: |
{ {
"imageOutcome": "${{ steps.build_image.outcome }}", "imageOutcome": "${{ steps.build_image.outcome }}",
"buildOutcome": "${{ steps.build_site.outcome }}", "buildOutcome": "${{ steps.build_site.outcome }}",
"deployOutcome": "${{ steps.deploy_site.outcome }}", "deployOutcome": "${{ steps.deploy_site.outcome }}",
"deployWebHost": "${{ env.WEB_HOST }}", "deployWebHost": "${{ env.WEB_VHOST }}",
"deployWebContext": "${{ env.WEB_CONTEXT }}", "deployWebContext": "${{ env.WEB_CONTEXT }}",
"gitActor": "${{ gitea.actor }}", "gitActor": "${{ forgejo.actor }}",
"gitEventName": "${{ gitea.event_name }}", "gitEventName": "${{ forgejo.event_name }}",
"gitWorkflow": "${{ gitea.workflow }}", "gitWorkflow": "${{ forgejo.workflow }}",
"gitRunNumber": "${{ gitea.run_number }}", "gitRunNumber": "${{ forgejo.run_number }}",
"gitRunAttempt": "${{ gitea.run_attempt }}" "gitRunAttempt": "${{ forgejo.run_attempt }}"
} }
config-file: ".gitea/pr-commenter.yml" config-file: ".gitea/pr-commenter.yml"

View file

@ -6,10 +6,10 @@ on:
types: [ closed ] types: [ closed ]
env: env:
WEB_DOMAIN: lafs.eval.latfa.net WEB_HOST: webforge.of.tahoe-lafs.org
WEB_USER: www WEB_USER: www
WEB_ROOT: /var/www/preview WEB_ROOT: /var/www/preview
WEB_CONTEXT: "/${{ gitea.event.pull_request.number }}/" WEB_CONTEXT: "/${{ forgejo.event.pull_request.number }}/"
jobs: jobs:
jekyll_cleanup: jekyll_cleanup:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
@ -32,4 +32,4 @@ jobs:
chmod 600 ~/.ssh/id_ed25519 chmod 600 ~/.ssh/id_ed25519
# Delete preview context from the remote site # Delete preview context from the remote site
echo -e "set sftp:connect-program ssh -a -x -o StrictHostKeyChecking=no; rm -r -f ${WEB_ROOT}${WEB_CONTEXT}\nbye" \ echo -e "set sftp:connect-program ssh -a -x -o StrictHostKeyChecking=no; rm -r -f ${WEB_ROOT}${WEB_CONTEXT}\nbye" \
| lftp sftp://${WEB_USER}:unused@${WEB_DOMAIN} | lftp sftp://${WEB_USER}:unused@${WEB_HOST}