Skip to content

Commit dbdc240

Browse files
committed
Github pages deployment
1 parent 291ce42 commit dbdc240

File tree

3 files changed

+34
-24
lines changed

3 files changed

+34
-24
lines changed

.github/workflows/deploy.yml

Lines changed: 33 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,53 @@
1-
name: Deploy Docusaurus to GitHub Pages
1+
name: Deploy to GitHub Pages
22

33
on:
44
push:
55
branches:
66
- main
7-
8-
permissions:
9-
contents: write # Grants GitHub Actions write access to the repo
10-
pages: write
11-
id-token: write
7+
# Optional: Define triggers, paths, etc.
8+
# See: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
129

1310
jobs:
14-
deploy:
11+
build:
12+
name: Build Docusaurus
1513
runs-on: ubuntu-latest
1614
steps:
17-
- name: Checkout code
18-
uses: actions/checkout@v4
15+
- uses: actions/checkout@v4
1916
with:
20-
persist-credentials: false # Prevents SSH key issues
17+
fetch-depth: 0 # Ensures full history for proper deployments
2118

22-
- name: Set up Node.js
23-
uses: actions/setup-node@v4
19+
- uses: actions/setup-node@v4
2420
with:
2521
node-version: 18
26-
cache: 'yarn'
22+
cache: yarn
2723

2824
- name: Install dependencies
2925
run: yarn install --frozen-lockfile
3026

31-
- name: Build Docusaurus site
27+
- name: Build website
3228
run: yarn build
3329

30+
- name: Upload Build Artifact
31+
uses: actions/upload-pages-artifact@v3
32+
with:
33+
path: build # Upload the generated static site for deployment
34+
35+
deploy:
36+
name: Deploy to GitHub Pages
37+
needs: build
38+
39+
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
40+
permissions:
41+
pages: write # Allows deployment to GitHub Pages
42+
id-token: write # Verifies the deployment originates from an appropriate source
43+
44+
# Deploy to the GitHub Pages environment
45+
environment:
46+
name: github-pages
47+
url: ${{ steps.deployment.outputs.page_url }}
48+
49+
runs-on: ubuntu-latest
50+
steps:
3451
- name: Deploy to GitHub Pages
35-
env:
36-
GIT_USER: github-actions[bot]
37-
USE_SSH: false
38-
GIT_URL: https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/blacksky-algorithms/blacksky-algorithms.github.io.git
39-
run: |
40-
git config --global user.name "github-actions[bot]"
41-
git config --global user.email "github-actions[bot]@users.noreply.github.com"
42-
git remote set-url origin $GIT_URL
43-
yarn deploy
52+
id: deployment
53+
uses: actions/deploy-pages@v4

docusaurus.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const config: Config = {
1313
organizationName: 'blacksky-algorithms',
1414
projectName: 'blacksky-algorithms.github.io',
1515
trailingSlash: false,
16-
deploymentBranch: 'main',
16+
deploymentBranch: 'gh-pages',
1717
onBrokenLinks: 'throw',
1818
onBrokenMarkdownLinks: 'warn',
1919
// Even if you don't use internationalization, you can use this field to set

CNAME renamed to static/CNAME

File renamed without changes.

0 commit comments

Comments
 (0)