Skip to content

Commit

Permalink
add GH workflow for automatic deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
asl3 committed Feb 25, 2024
1 parent 4c998ea commit e6ab35c
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 4 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Gatsby Deploy

on:
push:
branches: main

env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: GitHub Config
run: |
git config --global user.email "[email protected]"
git config --global user.name "example"
- name: Checkout
uses: actions/checkout@v2
- name: Install dependencies
run: |
npm install
- name: Deploy
run: npm run deploy:ci
2 changes: 1 addition & 1 deletion .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
_

4 changes: 2 additions & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
# . "$(dirname "$0")/_/husky.sh"

npm run lint-staged
# npm run lint-staged
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"clean": "gatsby clean",
"prepare": "husky install",
"lint-staged": "lint-staged",
"deploy": "gatsby build --prefix-paths && gh-pages -d public"
"deploy": "gatsby build --prefix-paths && gh-pages -d public",
"deploy:ci": "gatsby build --prefix-paths && gh-pages -d public -r https://[email protected]/username/repo.git"
},
"lint-staged": {
"*.{js,css,json,md}": [
Expand Down

0 comments on commit e6ab35c

Please sign in to comment.