Skip to content

Commit 10b058f

Browse files
added deployment code
1 parent c4451fa commit 10b058f

File tree

1 file changed

+40
-8
lines changed

1 file changed

+40
-8
lines changed

.github/workflows/deploy.yml

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,21 @@ on:
66
- master
77
workflow_dispatch:
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+
15+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
16+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
17+
concurrency:
18+
group: "pages"
19+
cancel-in-progress: false
20+
921
jobs:
10-
deploy:
22+
# Build job
23+
build:
1124
runs-on: ubuntu-latest
1225
steps:
1326
- name: Checkout code
@@ -16,11 +29,30 @@ jobs:
1629
- name: Setup Pages
1730
uses: actions/configure-pages@v3
1831

19-
- name: Deploy to GitHub Pages
20-
uses: JamesIves/github-pages-deploy-action@v4
32+
- name: Upload artifact
33+
uses: actions/upload-pages-artifact@v3
2134
with:
22-
folder: . # The folder containing your index.html
23-
branch: gh-pages # The branch to deploy to
24-
clean: true # Automatically remove deleted files from the deployment branch
25-
single-commit: true # Keep only the latest commit on the deployment branch
26-
token: ${{ secrets.GITHUB_TOKEN }} # GitHub automatically provides this secret
35+
# Upload entire repository
36+
path: "."
37+
38+
# Deploy job
39+
deploy:
40+
# Add a dependency to the build job
41+
needs: build
42+
43+
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
44+
permissions:
45+
pages: write # to deploy to Pages
46+
id-token: write # to verify the deployment originates from an appropriate source
47+
48+
# Deploy to the github-pages environment
49+
environment:
50+
name: github-pages
51+
url: ${{ steps.deployment.outputs.page_url }}
52+
53+
# Specify runner + deployment step
54+
runs-on: ubuntu-latest
55+
steps:
56+
- name: Deploy to GitHub Pages
57+
id: deployment
58+
uses: actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action

0 commit comments

Comments
 (0)