Skip to content

Commit ac50556

Browse files
Update deploy.yml
1 parent 0affe54 commit ac50556

File tree

1 file changed

+45
-26
lines changed

1 file changed

+45
-26
lines changed

.github/workflows/deploy.yml

Lines changed: 45 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,51 @@
1-
name: Deploy to GitHub Pages
1+
# Simple workflow for deploying static content to GitHub Pages
2+
name: Deploy Digital Clock to Pages
23

34
on:
4-
push:
5-
branches:
6-
- main
5+
# Runs on pushes targeting the default branch
6+
push:
7+
branches: ['main']
78

8-
jobs:
9-
deploy:
10-
runs-on: ubuntu-latest
11-
12-
steps:
13-
- name: Checkout Code
14-
uses: actions/checkout@v3
9+
# Allows you to run this workflow manually from the Actions tab
10+
workflow_dispatch:
1511

16-
- name: Setup Node.js
17-
uses: actions/setup-node@v3
18-
with:
19-
node-version: 18
12+
# Sets the GITHUB_TOKEN permissions to allow deployment to GitHub Pages
13+
permissions:
14+
contents: read
15+
pages: write
16+
id-token: write
2017

21-
- name: Install Dependencies
22-
run: yarn install
18+
# Allow one concurrent deployment
19+
concurrency:
20+
group: 'pages'
21+
cancel-in-progress: true
2322

24-
- name: Build Project
25-
run: yarn build
26-
27-
- name: Deploy to GitHub Pages
28-
uses: peaceiris/actions-gh-pages@v3
29-
with:
30-
github_token: ${{ secrets.GH_PAGES_TOKEN }}
31-
publish_dir: ./dist
32-
publish_branch: gh-pages
23+
jobs:
24+
# Single deploy job since we're just deploying
25+
deploy:
26+
environment:
27+
name: github-pages
28+
url: ${{ steps.deployment.outputs.page_url }}
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Checkout
32+
uses: actions/checkout@v4
33+
- name: Set up Node
34+
uses: actions/setup-node@v4
35+
with:
36+
node-version: 20
37+
cache: 'yarn'
38+
- name: Install dependencies
39+
run: yarn install --frozen-lockfile
40+
- name: Build
41+
run: yarn build
42+
- name: Setup Pages
43+
uses: actions/configure-pages@v4
44+
- name: Upload artifact
45+
uses: actions/upload-pages-artifact@v3
46+
with:
47+
# Upload dist folder
48+
path: './dist'
49+
- name: Deploy to GitHub Pages
50+
id: deployment
51+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)