Skip to content

Commit ee7bbb6

Browse files
authored
Update build-repo.yml
1 parent 5334386 commit ee7bbb6

1 file changed

Lines changed: 16 additions & 7 deletions

File tree

.github/workflows/build-repo.yml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1-
name: Build and Deploy
1+
name: Build and Deploy to GitHub Pages
22

33
on:
44
push:
55
branches:
66
- '**' # Run on all branches
77
workflow_dispatch:
88

9+
permissions:
10+
pages: write
11+
id-token: write
12+
913
jobs:
1014
build:
1115
runs-on: ubuntu-latest
@@ -34,7 +38,7 @@ jobs:
3438
fi
3539
fi
3640
37-
- name: Upload artifacts
41+
- name: Upload build artifacts
3842
uses: actions/upload-artifact@v4
3943
with:
4044
name: build-artifacts
@@ -48,11 +52,14 @@ jobs:
4852
container: archlinux:latest
4953
needs: build
5054
if: github.ref == 'refs/heads/main'
55+
environment:
56+
name: github-pages
57+
url: ${{ steps.deployment.outputs.page_url }}
5158
steps:
5259
- name: Checkout code
5360
uses: actions/checkout@v4
5461

55-
- name: Download artifacts
62+
- name: Download build artifacts
5663
uses: actions/download-artifact@v4
5764
with:
5865
name: build-artifacts
@@ -67,9 +74,11 @@ jobs:
6774
echo "Root index preview:"
6875
head -n 20 public/index.html || true
6976
70-
- name: Upload deploy artifacts
71-
uses: actions/upload-artifact@v4
77+
- name: Upload Pages artifact
78+
uses: actions/upload-pages-artifact@v3
7279
with:
73-
name: deploy-artifacts
7480
path: public
75-
retention-days: 7
81+
82+
- name: Deploy to GitHub Pages
83+
id: deployment
84+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)