Skip to content

Commit 67dc2d6

Browse files
committed
rm ~/OneDrive/Desktop/layer5.academy-theme/academy-theme/.git/.COMMIT_EDITMSG.swpci: add deployment preview workflow
Signed-off-by: varsha <varsha.narvi.07@gmail.com>
1 parent 495fdd9 commit 67dc2d6

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

.github/workflows/preview.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Deployment Preview
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
7+
jobs:
8+
deploy-preview:
9+
name: Build and Deploy Preview
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
with:
16+
submodules: recursive
17+
fetch-depth: 0
18+
19+
- name: Setup Hugo
20+
uses: peaceiris/actions-hugo@v3
21+
with:
22+
hugo-version: 'latest'
23+
extended: true
24+
25+
- name: Install Node.js dependencies
26+
run: |
27+
if [ -f package.json ]; then
28+
npm ci
29+
fi
30+
31+
- name: Build Hugo site
32+
run: hugo --minify --baseURL "/"
33+
34+
- name: Deploy Preview to Netlify
35+
uses: nwtgck/actions-netlify@v3
36+
with:
37+
publish-dir: './public'
38+
production-deploy: false
39+
github-token: ${{ secrets.GITHUB_TOKEN }}
40+
deploy-message: "Deploy preview for PR #${{ github.event.number }}"
41+
alias: deploy-preview-${{ github.event.number }}
42+
enable-pull-request-comment: true
43+
enable-commit-comment: false
44+
overwrites-pull-request-comment: true
45+
env:
46+
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
47+
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
48+
timeout-minutes: 10

0 commit comments

Comments
 (0)