Skip to content

Commit e54f784

Browse files
authored
Update deploy.yml
1 parent 2675479 commit e54f784

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

.github/workflows/deploy.yml

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,35 @@ on:
55
branches:
66
- github
77

8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
813
jobs:
914
build:
1015
runs-on: ubuntu-latest
11-
16+
1217
steps:
1318
- name: Checkout repository
14-
uses: actions/checkout@v2
19+
uses: actions/checkout@v4
1520

1621
- name: Set up JDK 11
17-
uses: actions/setup-java@v2
22+
uses: actions/setup-java@v3
1823
with:
1924
distribution: 'adopt'
2025
java-version: '11'
2126

2227
- name: Build with Maven
2328
run: mvn clean install
2429

30+
- name: Setup Pages
31+
uses: actions/configure-pages@v4
32+
33+
- name: Upload artifact
34+
uses: actions/upload-pages-artifact@v3
35+
with:
36+
path: target/
37+
2538
- name: Deploy to GitHub Pages
26-
run: |
27-
mkdir -p out
28-
cp -r target/* out/
29-
cd out
30-
git init
31-
git config user.name "github-actions[bot]"
32-
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
33-
git add .
34-
git commit -m "Deploy to GitHub Pages"
35-
git push --force "https://${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git" master:github
39+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)