1
0
Fork 0
Go to file
Rita Pages ff506a0eaf Update README.md 2023-09-23 18:06:28 +00:00
README.md Update README.md 2023-09-23 18:06:28 +00:00

README.md

Pages

For a user/org

  • Create a pages repository.
  • Push HTML files to the default branch, at the root.
  • Your pages is available at https://<user/org>.rossweisse.site/.

For a project

  • Create a pages branch.
  • Push HTML files to the branch, at the root.
  • Your pages is available at https://<user/org>.rossweisse.site/<repository>/

Note that you can force an another branch: https://<user/org>.rossweisse.site/<repository>/@<branch>.
Slashes in branch names should be replaced by a tilde (so branch fix/thing would be fix~thing).

Example: The README.md inside RadioBrony/rb-nuxt on the live branch: https://radiobrony.rossweisse.site/rb-nuxt/@live/README.md

RAW

Use this format, it will return files in text/plain MIME.
https://raw.rossweisse.site/<user/org>/<repository>[/@<branch>]/<path to file>

Example: https://raw.rossweisse.site/RadioBrony/rb-nuxt/@live/README.md

Custom domains

THIS IS EXPERIMENTAL (AND MAYBE LIMITED)

You'll need to do two things:

  • Add a .domains to the root of the pages branch with the domain(s) to use, one per line.
    Lines starting with a # will be ignored.
    Also include all possible *.rossweisse.site domains if you still want them to work.
  • Adapt your DNS.

DNS

Please note the destinations:

  • For a user/org: <user/repo>.rossweisse.site (which is the same as pages.<user/repo>.rossweisse.site)
  • For a project: <repository>.<user/repo>.rossweisse.site
  • If you want to specify a branch: <branch>.<repository>.<user/repo>.rossweisse.site

Taking that into account, if you want to add a custom domain to a user/org and make all possibilities still work, your .domains could look like this (for user "kody", repo "pages", branch "pages"):

kody.moe
kody.rossweisse.site
pages.kody.rossweisse.site
pages.pages.kody.rossweisse.site

Option 1: CNAME

  • Add a "CNAME" entry pointing to the destination like above.

Option 2: ALIAS

  • Set an "ALIAS" entry pointing to rossweisse.site
  • Set a "TXT" entry for the same domain with the destination.
  • (optional) Add www as a "CNAME" pointing to your main domain.

Option 3: A/AAAA

  • Add an "A" entry with the value 207.154.241.53
  • Add an "AAAA" entry with the value 2a03:b0c0:3:d0::113c:2001
  • Set a "TXT" entry for the same domain with the destination.
  • (optional) Add www as a "CNAME" pointing to your main domain.

Use Actions to (build and) deploy a directory

Create a new file under .forgejo/workflows/, let's call it pages.yml.

Here's an example that will prepare Python and build Sphinx documentation.

name: Pages

on:
  push:
    branches: [main]

jobs:
  pages:
    name: Pages

    # Skip if asked to
    if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}

    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v3

      - name: Set up Python environment
        uses: https://github.com/actions/setup-python@v4
        with:
          python-version: "3.11"

      - name: Install python dependencies
        run: |
          pip install -U sphinx
          pip install sphinx_rtd_theme          

      - name: Build
        # Type: "html", input dir: "docs", output dir: "public"
        run: TZ=UTC sphinx-build -b html docs public

      - name: Deploy
        uses: https://github.com/peaceiris/actions-gh-pages@v3
        with:
          # This secret is automatically set
          github_token: ${{ secrets.GITHUB_TOKEN }}
          # The directory to deploy
          publish_dir: ./public
          # "pages" is the branch name we use
          publish_branch: pages
  • Make sure to limit the branch that will run this action, like here with branches: [main]
  • The most important part is the name: Deploy step. Adapt publish_dir with the output of your static site.