Skip to content

Commit

Permalink
add docu & set permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
CubicrootXYZ committed Oct 20, 2024
1 parent f6813de commit dada5b9
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 6 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/pages.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
on:
workflow_call:
inputs:
spec_artifact_name:
artifact_name:
required: true
type: string
spec_artifact_path:
artifact_path:
required: true
type: string

Expand All @@ -18,8 +18,8 @@ jobs:
steps:
- uses: actions/download-artifact@master
with:
name: "{{ inputs.spec_artifact_name }}"
path: "{{ inputs.spec_artifact_path }}"
name: "{{ inputs.artifact_name }}"
path: "{{ inputs.artifact_path }}"
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/pages_test.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
on: push

permissions:
contents: read
pages: write
id-token: write

jobs:
pages_test_prep:
runs-on: ubuntu-latest
Expand All @@ -15,5 +20,5 @@ jobs:
- pages_test_prep
uses: ./.github/workflows/pages.yaml
with:
spec_artifact_name: static-html
spec_artifact_path: tests/pages/index.html
artifact_name: static-html
artifact_path: tests/pages/index.html
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,28 @@ jobs:
with:
entrypoint: cmd/main.go
workdir: ./
```

## GitHub Pages

Make sure GitHub pages are activated and set to "GitHub Action" in your repository settings.

Add the following permissions to the `workflows` file:

```yaml
permissions:
contents: read
pages: write
id-token: write
```

To deploy an artifact to GitHub pages use the following job:

```yaml
jobs:
pages_test:
uses: CubicrootXYZ/Workflows/.github/workflows/pages.yaml
with:
artifact_name: static-html
artifact_path: index.html
```

0 comments on commit dada5b9

Please sign in to comment.