Skip to content

Commit d64c08f

Browse files
committed
✨ docs deployment
1 parent 0665c5d commit d64c08f

File tree

6 files changed

+58
-25
lines changed

6 files changed

+58
-25
lines changed

.github/workflows/release.yaml

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ jobs:
3333
needs: release
3434
if: github.repository_owner == 'juftin'
3535
permissions:
36-
contents: write
36+
pages: write
37+
id-token: write
38+
environment:
39+
name: github-pages
40+
url: ${{ steps.deployment.outputs.page_url }}
3741
steps:
3842
- name: Checkout Latest Changes
3943
uses: actions/checkout@v4
@@ -46,12 +50,19 @@ jobs:
4650
python-version: "3.11"
4751
- name: Install Hatch
4852
run: |
49-
python -m pip install --upgrade pip
53+
python -m pip install --upgrade pip wheel
5054
python -m pip install -q hatch pre-commit
5155
hatch --version
52-
- name: Set Up GitHub Actions User
53-
run: |
54-
git config user.name "github-actions[bot]"
55-
git config user.email "github-actions[bot]@users.noreply.github.com"
56-
- name: Deploy Documentation Changes
57-
run: hatch run docs:deploy --force
56+
- name: Create Virtual Environment
57+
run: hatch env create docs
58+
- name: Build Site
59+
run: hatch run docs:build
60+
- name: Setup GitHub Pages
61+
uses: actions/configure-pages@v4
62+
- name: Upload Artifact
63+
uses: actions/upload-pages-artifact@v3
64+
with:
65+
path: site/
66+
- name: Deploy to GitHub Pages
67+
id: deployment
68+
uses: actions/deploy-pages@v4

mkdocs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ repo_name: cookiecutter-python
3131
edit_uri: blob/main/docs/
3232
site_author: juftin
3333
remote_branch: gh-pages
34-
copyright: Copyright © 2023 Justin Flannery
34+
copyright: Copyright © 2024 Justin Flannery
3535
extra:
3636
generator: false
3737
markdown_extensions:

tests/example-project/.github/workflows/release.yaml

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@ jobs:
4646
needs: release
4747
if: github.ref == 'refs/heads/main' && github.repository_owner == 'juftin'
4848
permissions:
49-
contents: write
49+
pages: write
50+
id-token: write
51+
environment:
52+
name: github-pages
53+
url: ${{ steps.deployment.outputs.page_url }}
5054
steps:
5155
- name: Checkout Latest Changes
5256
uses: actions/checkout@v4
@@ -62,9 +66,16 @@ jobs:
6266
python -m pip install --upgrade pip wheel
6367
python -m pip install -q hatch pre-commit
6468
hatch --version
65-
- name: Set Up GitHub Actions User
66-
run: |
67-
git config user.name "github-actions[bot]"
68-
git config user.email "github-actions[bot]@users.noreply.github.com"
69-
- name: Deploy Documentation Changes
70-
run: hatch run docs:gh-deploy --force
69+
- name: Create Virtual Environment
70+
run: hatch env create docs
71+
- name: Build Site
72+
run: hatch run docs:build
73+
- name: Setup GitHub Pages
74+
uses: actions/configure-pages@v4
75+
- name: Upload Artifact
76+
uses: actions/upload-pages-artifact@v3
77+
with:
78+
path: site/
79+
- name: Deploy to GitHub Pages
80+
id: deployment
81+
uses: actions/deploy-pages@v4

tests/example-project/LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright © 2023 Justin Flannery
3+
Copyright © 2024 Justin Flannery
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

tests/example-project/mkdocs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ repo_name: example-project
3232
edit_uri: blob/main/docs/
3333
site_author: juftin
3434
remote_branch: gh-pages
35-
copyright: Copyright © 2023 Justin Flannery
35+
copyright: Copyright © 2024 Justin Flannery
3636
extra:
3737
generator: false
3838
exclude_docs: |

{{cookiecutter.repo_name}}/.github/workflows/release.yaml

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@ jobs:
4646
needs: release
4747
if: github.ref == 'refs/heads/{{ cookiecutter.default_branch }}' && github.repository_owner == '{{ cookiecutter.github_username }}'
4848
permissions:
49-
contents: write
49+
pages: write
50+
id-token: write
51+
environment:
52+
name: github-pages
53+
url: ${{"{{"}} steps.deployment.outputs.page_url {{"}}"}}
5054
steps:
5155
- name: Checkout Latest Changes
5256
uses: actions/checkout@v4
@@ -62,9 +66,16 @@ jobs:
6266
python -m pip install --upgrade pip wheel
6367
python -m pip install -q hatch pre-commit
6468
hatch --version
65-
- name: Set Up GitHub Actions User
66-
run: |
67-
git config user.name "github-actions[bot]"
68-
git config user.email "github-actions[bot]@users.noreply.github.com"
69-
- name: Deploy Documentation Changes
70-
run: hatch run docs:gh-deploy --force
69+
- name: Create Virtual Environment
70+
run: hatch env create docs
71+
- name: Build Site
72+
run: hatch run docs:build
73+
- name: Setup GitHub Pages
74+
uses: actions/configure-pages@v4
75+
- name: Upload Artifact
76+
uses: actions/upload-pages-artifact@v3
77+
with:
78+
path: site/
79+
- name: Deploy to GitHub Pages
80+
id: deployment
81+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)