PackwizJS/.forgejo/workflows/docs.yml
cswimr 1b481c5d52
All checks were successful
Actions / Build and Push Documentation (push) Successful in 14s
fix docs build again
really bro
2025-02-09 16:19:28 -06:00

53 lines
2 KiB
YAML

name: Actions
on:
push:
branches:
- main
jobs:
docs:
name: Build and Push Documentation
runs-on: docker
container: catthehacker/ubuntu:act-latest@sha256:89367f3c5437699c6b43fa941041725bcc77682a46f2bbe6557541e384d9cedb
steps:
- name: Checkout repository
uses: https://github.com/actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Setup Bun
uses: https://github.com/oven-sh/setup-bun@4bc047ad259df6fc24a6c9b0f9a0cb08cf17fbe5 # v2
with:
bun-version: latest
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Set environment variables
uses: https://c.csw.im/actions/env@1791216cd180e6578dd1d67fb8d2852b883a5f53 # v2
- name: Build Documentation
run: |
if [ "$CI_ACTION_REF_NAME_SLUG" != "main" ]; then
export SITE_URL="https://$CI_ACTION_REF_NAME_SLUG.packwizjs.csw.im"
else
export SITE_URL="https://packwizjs.csw.im"
fi
bun docs --logLevel Verbose --hostedBaseUrl $SITE_URL --useHostedBaseUrlForAbsoluteLinks true
- name: Deploy documentation to Meli
run: |
GREEN='\033[0;32m'
YELLOW='\033[0;33m'
BLUE='\033[0;34m'
unset GITHUB_TOKEN
unset GITLAB_TOKEN
echo "${YELLOW}Deploying to ${BLUE}Meli ${YELLOW}on branch ${GREEN}$CI_ACTION_REF_NAME_SLUG${YELLOW}...\n"
npx -p "@getmeli/cli" meli upload ./.generated_docs/html \
--url "https://meli.csw.im" \
--site "${{ vars.MELI_SITE_ID }}" \
--token "${{ secrets.MELI_SITE_SECRET }}" \
--release "$CI_ACTION_REF_NAME_SLUG/${{ env.GITHUB_SHA }}" \
--branch "$CI_ACTION_REF_NAME_SLUG"
echo "\n${YELLOW}Deployed to ${BLUE}Meli ${YELLOW}on branch ${GREEN}$CI_ACTION_REF_NAME_SLUG${YELLOW}!"
echo "${GREEN}https://$CI_ACTION_REF_NAME_SLUG.packwizjs.csw.im/"
env:
GITEA_TOKEN: ${{ github.token }}