Skip to content

Commit

Permalink
chore: add deploy workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
zoruka committed Jun 26, 2024
1 parent 5a96a32 commit 0b705e3
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 12 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Github Pages Deploy

on:
push:
branches: [ "main" ]

jobs:
build-and-deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Install Dependencies
run: yarn install

- name: Setup Git Config
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Build Project and Deploy to Github Pages
run: yarn deploy
27 changes: 15 additions & 12 deletions deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,19 @@ import { publish } from 'gh-pages';
console.log('Deploy Started!');

publish(
'out',
{
branch: 'gh-pages',
nojekyll: true,
cname: 'www.zoruka.xyz',
},
(error) => {
if (error) {
console.error(error);
}
console.log('Deploy Complete!');
}
'out',
{
branch: 'gh-pages',
nojekyll: true,
cname: 'www.zoruka.xyz',
},
(error) => {
if (error) {
console.error('[ERROR]', error);

throw new Error('Deploy Failed!');
}

console.log('Deploy Complete!');
}
);

0 comments on commit 0b705e3

Please sign in to comment.