2023-08-16 05:31:01 -04:00
|
|
|
name: pr
|
|
|
|
|
|
|
|
on:
|
2023-12-25 17:58:03 -05:00
|
|
|
pull_request_target:
|
2023-08-16 05:31:01 -04:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
preview:
|
|
|
|
runs-on: docker
|
|
|
|
container:
|
|
|
|
image: node:20
|
|
|
|
steps:
|
|
|
|
- uses: https://code.forgejo.org/actions/checkout@v3
|
2023-12-27 12:19:42 -05:00
|
|
|
with:
|
|
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
2023-08-16 11:34:40 -04:00
|
|
|
- name: lint
|
|
|
|
run: |
|
|
|
|
corepack enable
|
|
|
|
pnpm install --frozen-lockfile
|
|
|
|
pnpm run lint:remark
|
2023-09-18 10:56:16 -04:00
|
|
|
pnpm run format:prettier
|
|
|
|
git diff --exit-code
|
2023-12-31 10:21:52 -05:00
|
|
|
- name: scripts/cli-docs.sh
|
|
|
|
run: |
|
|
|
|
scripts/cli-docs.sh run ${{ env.GITHUB_BASE_REF }} > docs/admin/command-line.md
|
|
|
|
git diff --exit-code
|
2024-11-17 17:47:09 -05:00
|
|
|
- name: release-schedule
|
|
|
|
run: |
|
|
|
|
pnpm run update-schedule
|
2024-11-19 05:14:53 -05:00
|
|
|
git diff --exit-code || (echo "Error: Run 'pnpm run update-schedule' to generate the markdown release schedule and commit it" && false)
|
2023-08-16 05:31:01 -04:00
|
|
|
- name: get forgejo.org and move the docs
|
|
|
|
run: |
|
|
|
|
git clone --recursive --depth 1 https://codeberg.org/forgejo/website/ /tmp/website
|
2023-08-16 06:32:04 -04:00
|
|
|
apt-get update -qq && apt-get install -qq -y rsync
|
|
|
|
rsync -av --delete ./ /tmp/website/forgejo-docs/${{ env.GITHUB_BASE_REF }}/
|
2023-08-16 05:31:01 -04:00
|
|
|
- name: install
|
|
|
|
run: |
|
|
|
|
cd /tmp/website
|
|
|
|
corepack enable
|
|
|
|
pnpm install --frozen-lockfile
|
2023-08-17 17:46:01 -04:00
|
|
|
- name: build
|
2023-08-16 05:31:01 -04:00
|
|
|
run: |
|
|
|
|
cd /tmp/website
|
|
|
|
colon=':'
|
2023-12-27 12:34:38 -05:00
|
|
|
branch=docs_pull_${{ github.event.pull_request.number }}
|
2023-08-22 17:44:26 -04:00
|
|
|
sed -i.orig -e "s|origin$colon '.*|origin$colon 'https$colon//forgejo.codeberg.page',|" -e "s|basePathname$colon '/'|basePathname$colon '/@$branch//'|" src/config.ts
|
|
|
|
cat src/config.ts
|
2023-08-16 05:31:01 -04:00
|
|
|
corepack enable
|
|
|
|
pnpm run build
|
2023-08-17 17:46:01 -04:00
|
|
|
mv dist /tmp
|
|
|
|
- name: preview
|
|
|
|
if: ${{ secrets.WEBSITETOKEN != '' }}
|
|
|
|
uses: https://code.forgejo.org/forgejo/action-website-preview@main
|
|
|
|
with:
|
|
|
|
directory: /tmp/dist
|
2023-12-25 18:24:53 -05:00
|
|
|
name: 'docs_pull_${{ github.event.pull_request.number }}'
|
2023-08-17 17:46:01 -04:00
|
|
|
pages-token: ${{ secrets.WEBSITETOKEN }}
|
|
|
|
repository: forgejo/docs
|
|
|
|
repository-host: codeberg.org
|
|
|
|
repository-token: ${{ secrets.WEBSITETOKEN }}
|
2023-12-25 18:24:53 -05:00
|
|
|
pr-number: ${{ github.event.pull_request.number }}
|