Skip to content

Commit

Permalink
Revert make action composite
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkKremer committed Oct 24, 2024
1 parent 0823e2c commit 1db16b8
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 65 deletions.
29 changes: 0 additions & 29 deletions .github/actions/docgen/action.yml

This file was deleted.

20 changes: 17 additions & 3 deletions .github/workflows/github-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,33 @@ on:
branches: ['main']

jobs:

upload-docs:
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
env:
DOCS_DIR: 'docs/'
BRANCH: 'main'
OUTPUT_DIR: '_site/'
MAIN_BRANCH: 'main'
steps:
- name: Configure pages
uses: actions/configure-pages@v5
id: configure-pages
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ env.MAIN_BRANCH }}
fetch-depth: 0 # checkout a non-shallow copy so the generator can generate docs for all major versions
- uses: ./
with:
site-url: ${{ steps.configure-pages.outputs.base_url }}
docs-directory: ${{ env.DOCS_DIR }}
main-branch: ${{ env.BRANCH }}
output-directory: ${{ env.OUTPUT_DIR }}
main-branch: ${{ env.MAIN_BRANCH }}
- name: Upload pages
uses: actions/upload-pages-artifact@v3
with:
path: ${{ env.OUTPUT_DIR }}
- name: Deploy pages
uses: actions/deploy-pages@v4
43 changes: 12 additions & 31 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: 'gopxl docs'
author: 'Mark Kremer'
description: 'A static website generator for the gopxl Markdown documentation'
inputs:
site-url:
description: "URL the site will be deployed to (https://owner.github.com/project)"
required: true
github-url:
description: "URL to the Github repository"
default: ${{ github.server_url }}/${{ github.repository }}
Expand All @@ -16,35 +19,13 @@ inputs:
main-branch:
description: 'Branch to publish alongside tagged versions'
required: true
# temporary, figure out another solution.
action-repository:
description: "for internal use"
default: ${{ github.action_repository }}
action-ref:
description: "for internal use"
default: ${{ github.action_ref }}
runs:
using: 'composite'
steps:
- name: Configure pages
uses: actions/configure-pages@v5
id: configure-pages
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ inputs.main-branch }}
fetch-depth: 0 # checkout a non-shallow copy so the generator can generate docs for all major versions
- name: Generate static site
uses: ${{ inputs.action-repository }}/.github/actions/docgen@${{ inputs.action-ref }}
with:
site-url: ${{ steps.configure-pages.outputs.base_url }}
github-url: ${{ inputs.github-url }}
docs-directory: ${{ inputs.docs-directory }}
output-directory: ${{ inputs.output-directory }}
main-branch: ${{ inputs.main-branch }}
- name: Upload pages
uses: actions/upload-pages-artifact@v3
with:
path: ${{ inputs.output-directory }}
- name: Deploy pages
uses: actions/deploy-pages@v4
using: 'docker'
image: 'Dockerfile'
env:
SITE_URL: ${{ inputs.site-url }}
GITHUB_URL: ${{ inputs.github-url }}
REPOSITORY_PATH: ./
DOCS_DIR: ${{ inputs.docs-directory }}
OUTPUT_DIR: ${{ inputs.output-directory }}
MAIN_BRANCH: ${{ inputs.main-branch }}
20 changes: 18 additions & 2 deletions docs/01. Getting Started/01. Installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,26 @@ jobs:
pages: write
id-token: write
steps:
- name: Configure pages
uses: actions/configure-pages@v5
id: configure-pages
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ env.MAIN_BRANCH }}
fetch-depth: 0 # checkout a non-shallow copy so the generator can generate docs for all major versions
- uses: gopxl/docs@main
with:
docs-directory: 'docs/'
main-branch: 'main'
site-url: ${{ steps.configure-pages.outputs.base_url }}
docs-directory: ${{ env.DOCS_DIR }}
output-directory: ${{ env.OUTPUT_DIR }}
main-branch: ${{ env.MAIN_BRANCH }}
- name: Upload pages
uses: actions/upload-pages-artifact@v3
with:
path: ${{ env.OUTPUT_DIR }}
- name: Deploy pages
uses: actions/deploy-pages@v4
```
## Linking the site from the GitHub repository
Expand Down

0 comments on commit 1db16b8

Please sign in to comment.