Skip to content

Commit 564152a

Browse files
committed
Switch to actions/deploy-pages
This uses the currently beta feature of using GitHub Actions to deploy GitHub Pages, rather than using a gh-pages branch. This keeps the repository size smaller.
1 parent bda18f2 commit 564152a

File tree

1 file changed

+30
-10
lines changed

1 file changed

+30
-10
lines changed

.github/workflows/deploy.yml

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,47 @@
1+
---
12
name: Build and Deploy
3+
24
on:
35
push:
46
branches:
57
- master
68

9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
concurrency:
15+
group: "pages"
16+
cancel-in-progress: true
17+
718
jobs:
8-
build-and-deploy:
19+
build:
920
runs-on: ubuntu-latest
10-
if: github.repository == 'djangogirls/tutorial'
1121
steps:
1222
- name: Checkout
13-
uses: actions/checkout@v2
23+
uses: actions/checkout@v3
1424
with:
1525
persist-credentials: false
16-
1726
- name: Install and Build
1827
run: |
1928
npm install
2029
npx honkit build
21-
22-
- name: Deploy
23-
uses: JamesIves/github-pages-deploy-action@releases/v3
30+
- name: Upload artifact
31+
uses: actions/upload-pages-artifact@v1
2432
with:
25-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26-
BRANCH: gh-pages
27-
FOLDER: _book
33+
path: _book
34+
35+
deploy:
36+
needs: build
37+
permissions:
38+
pages: write
39+
id-token: write
40+
environment:
41+
name: github-pages
42+
url: ${{ steps.deployment.outputs.page_url }}
43+
runs-on: ubuntu-latest
44+
steps:
45+
- name: Deploy to GitHub Pages
46+
id: deployment
47+
uses: actions/deploy-pages@v2

0 commit comments

Comments
 (0)