Skip to content

Commit c8365bc

Browse files
author
Davi Castro Samora
committed
fix: update GitHub Actions permissions and use official Pages deployment
1 parent 163faeb commit c8365bc

1 file changed

Lines changed: 24 additions & 8 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ on:
66
pull_request:
77
branches: [ main ]
88

9+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
10+
permissions:
11+
contents: read
12+
pages: write
13+
id-token: write
14+
915
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
1016
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
1117
concurrency:
@@ -15,6 +21,12 @@ concurrency:
1521
jobs:
1622
build:
1723
runs-on: ubuntu-latest
24+
25+
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
26+
permissions:
27+
contents: read
28+
pages: write
29+
id-token: write
1830

1931
strategy:
2032
matrix:
@@ -76,13 +88,17 @@ jobs:
7688
mkdir -p out
7789
touch out/.nojekyll
7890
79-
- name: Deploy to GitHub Pages
80-
uses: peaceiris/actions-gh-pages@v3
91+
- name: Setup Pages
92+
uses: actions/configure-pages@v4
93+
if: github.ref == 'refs/heads/main'
94+
95+
- name: Upload artifact
96+
uses: actions/upload-pages-artifact@v2
8197
if: github.ref == 'refs/heads/main'
8298
with:
83-
github_token: ${{ secrets.GITHUB_TOKEN }}
84-
publish_dir: ./out
85-
# Enable Jekyll processing to be disabled
86-
enable_jekyll: false
87-
# Add CNAME if using custom domain
88-
# cname: your-domain.com
99+
path: ./out
100+
101+
- name: Deploy to GitHub Pages
102+
id: deployment
103+
uses: actions/deploy-pages@v3
104+
if: github.ref == 'refs/heads/main'

0 commit comments

Comments
 (0)