Skip to content

Translations update from Hosted Weblate #1643

Translations update from Hosted Weblate

Translations update from Hosted Weblate #1643

Workflow file for this run

on: pull_request_target
jobs:
authorize:
environment: ${{ github.event_name == 'pull_request_target' &&
github.event.pull_request.head.repo.full_name != github.repository &&
'external' || 'internal' }}
runs-on: ubuntu-latest
steps:
- run: true
publish:
needs: authorize
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
pull-requests: write
name: Publish Preview to Cloudflare Pages
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
- name: Check for missing base language strings
run: python3 find_missing_i18n_strings.py
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: "0.146.7"
extended: true
- name: Generate language files
run: python3 setup-pages-for-supported-languages.py
- name: Generate get_almalinux data
run: python3 tools/generate_get_almalinux_yaml.py
- name: Build
run: hugo --minify --buildFuture
- name: move redirects file into place
run: cp _redirects public/
- name: move headers file into place
run: cp _headers public/
- name: build search index
run: npx pagefind --site "public"
- name: Publish to Cloudflare Pages
id: deploy
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ vars.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy public --project-name=${{ vars.CLOUDFLARE_PROJECT_NAME }} --branch=${{ github.head_ref }}
- name: Comment deployment URL on PR
if: always() && github.event.pull_request.number
uses: actions/github-script@v7
with:
script: |
const aliasUrl = `${{ steps.deploy.outputs.pages-deployment-alias-url }}`;
const deploymentUrl = `${{ steps.deploy.outputs.deployment-url }}`;
const url = aliasUrl || deploymentUrl;
const status = `${{ steps.deploy.outcome }}`;
const body = status === "success" && url
? `✅ Preview deployment is ready: ${url}`
: `⚠️ Preview deployment step finished with status: ${status}.`;
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
body,
});