Skip to content

Commit 1008c48

Browse files
committed
feat: add cd, to have ci cd auto deployment to netlify
1 parent a25e6a4 commit 1008c48

2 files changed

Lines changed: 16 additions & 9 deletions

File tree

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CI
1+
name: CI/CD
22

33
on:
44
push:
@@ -10,7 +10,7 @@ permissions:
1010
contents: read
1111

1212
jobs:
13-
build:
13+
build-deploy:
1414
runs-on: ubuntu-latest
1515

1616
steps:
@@ -29,5 +29,12 @@ jobs:
2929
- name: Lint
3030
run: npm run lint --if-present
3131

32-
- name: Run build
32+
- name: Build
3333
run: npm run build
34+
35+
- name: Deploy to Netlify
36+
if: github.ref == 'refs/heads/main'
37+
run: npx netlify-cli deploy --dir=dist --site=$NETLIFY_SITE_ID --prod
38+
env:
39+
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
40+
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}

package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)