Skip to content

Commit 84889e1

Browse files
authored
Merge pull request #2 from terrestris/auto-publish
Prepare auto deployment
2 parents 02809e0 + 7493d04 commit 84889e1

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

.github/workflows/pages.yml

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Build & deploy
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
build:
13+
name: Build
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Prepare bun
21+
uses: oven-sh/setup-bun@v1
22+
with:
23+
bun-version: latest
24+
25+
- name: Installing
26+
run: bun i
27+
28+
- name: Building project
29+
run: bun run build
30+
31+
- name: Uploading production-ready dist files
32+
uses: actions/upload-artifact@v4
33+
with:
34+
name: production-files
35+
path: ./dist
36+
37+
deploy:
38+
name: Deploy
39+
needs: build
40+
runs-on: ubuntu-latest
41+
permissions:
42+
contents: write
43+
if: github.ref == 'refs/heads/main'
44+
45+
steps:
46+
- name: Downloading artifact
47+
uses: actions/download-artifact@v4
48+
with:
49+
name: production-files
50+
path: ./dist
51+
52+
- name: Deploying to gh-pages
53+
uses: peaceiris/actions-gh-pages@v4
54+
with:
55+
github_token: ${{ secrets.GITHUB_TOKEN }}
56+
publish_dir: ./dist

0 commit comments

Comments
 (0)