Skip to content

Commit 9f331e7

Browse files
committed
auto-deploy
1 parent 705acbf commit 9f331e7

1 file changed

Lines changed: 23 additions & 6 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,20 @@ name: Deploy to GitHub Pages
33
on:
44
push:
55
branches:
6-
- main
6+
- master
77

88
jobs:
99
deploy:
1010
runs-on: ubuntu-latest
1111

12+
permissions:
13+
pages: write
14+
id-token: write
15+
16+
environment:
17+
name: github-pages
18+
url: ${{ steps.deployment.outputs.page_url }}
19+
1220
steps:
1321
- name: Checkout repository
1422
uses: actions/checkout@v4
@@ -24,8 +32,17 @@ jobs:
2432
- name: Build project
2533
run: npm run build
2634

27-
- name: Deploy to gh-pages
28-
env:
29-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30-
run: |
31-
npx gh-pages -d build -r https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git
35+
- name: Add CNAME file to build directory
36+
run: echo "darkvoid.cc" > build/CNAME
37+
38+
- name: Setup Pages
39+
uses: actions/configure-pages@v4
40+
41+
- name: Upload artifact
42+
uses: actions/upload-pages-artifact@v3
43+
with:
44+
path: ./build
45+
46+
- name: Deploy to GitHub Pages
47+
id: deployment
48+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)