-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (55 loc) · 1.99 KB
/
deploy.yml
File metadata and controls
62 lines (55 loc) · 1.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Deploy 🕊️
on:
push:
branches:
- main #✎ Adjust to branch you want to deploy
workflow_dispatch:
inputs:
secrets_txt:
description: 'Paste secrets here (format: KEY=VALUE)'
required: false
jobs:
build_and_deploy:
name: Build & Deploy 🚀
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4.1.7
- name: Import secrets
env:
SECRETS_CONTEXT: ${{ toJSON(secrets) }}
run: |
echo "$SECRETS_CONTEXT" | jq -r 'to_entries[] | "\(.key)=\(.value)"' >> "$GITHUB_ENV"
- name: Setup Bun
uses: oven-sh/setup-bun@v1
- name: Install dependencies
run: |
bun install
if [ -f bun.lockb ]; then
if git ls-files --error-unmatch bun.lockb > /dev/null 2>&1; then
if ! git diff --quiet bun.lockb; then
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add bun.lockb
git commit -m "chore: update bun.lockb"
git push
fi
else
echo "bun.lockb is not tracked by Git. Adding it..."
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add bun.lockb
git commit -m "chore: add bun.lockb"
git push
fi
else
echo "bun.lockb does not exist. Skipping commit."
fi
- name: Build project
run: bun run build && touch ./dist/.nojekyll #✎ Adjust to your build output folder (dist or out)
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4.6.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: public
folder: dist #✎ Adjust to your build output folder (dist or out)