├── .github
└── workflows
│ └── publish.yml
└── README.md
/.github/workflows/publish.yml:
--------------------------------------------------------------------------------
1 | name: Publish site
2 |
3 | on:
4 | push:
5 | workflow_dispatch:
6 |
7 | permissions:
8 | pages: write
9 | id-token: write
10 |
11 | jobs:
12 | build:
13 | runs-on: ubuntu-latest
14 | steps:
15 | - uses: actions/checkout@v4
16 | - name: Build the site
17 | run: |
18 | mkdir _site
19 | echo '
Hello, world!
' > _site/index.html
20 | - name: Upload artifact
21 | uses: actions/upload-pages-artifact@v3
22 | deploy:
23 | environment:
24 | name: github-pages
25 | url: ${{ steps.deployment.outputs.page_url }}
26 | runs-on: ubuntu-latest
27 | needs: build
28 | steps:
29 | - name: Deploy to GitHub Pages
30 | id: deployment
31 | uses: actions/deploy-pages@v4
32 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Publish to GitHub Pages from GitHub Actions
2 |
3 | See [Building and deploying a custom site using GitHub Actions and GitHub Pages](https://til.simonwillison.net/github-actions/github-pages) for an explanation of the pattern embodied by this repository template.
4 |
5 | You will need to access Settings -> Pages and set the "Build and Deployment" source to "GitHub Actions".
6 |
--------------------------------------------------------------------------------