parent
0a49531a71
commit
26647303c6
2 changed files with 27 additions and 49 deletions
27
.forgejo/workflows/deploy.yml
Normal file
27
.forgejo/workflows/deploy.yml
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
runs-on: docker
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Check out repo
|
||||||
|
uses: https://data.forgejo.org/actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup Bun
|
||||||
|
uses: oven-sh/setup-bun@v2
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: bun install --frozen-lockfile
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: bun run build
|
||||||
|
|
||||||
|
- name: Install rsync
|
||||||
|
run: apt-get update && apt-get install -y rsync
|
||||||
|
|
||||||
|
- name: Deploy
|
||||||
|
run: rsync -a --delete dist/ /var/lib/www/tensamin-homepage/
|
||||||
49
.github/workflows/update.yml
vendored
49
.github/workflows/update.yml
vendored
|
|
@ -1,49 +0,0 @@
|
||||||
name: Deploy to GitHub Pages
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
deploy:
|
|
||||||
name: Deploy to GitHub Pages
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Set up Bun
|
|
||||||
uses: oven-sh/setup-bun@v1
|
|
||||||
with:
|
|
||||||
bun-version: latest
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: bun install --frozen-lockfile
|
|
||||||
|
|
||||||
- name: Build project
|
|
||||||
run: bun --bun run build
|
|
||||||
|
|
||||||
- name: Ensure deploy branch exists
|
|
||||||
run: |
|
|
||||||
git config user.name "github-actions[bot]"
|
|
||||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
||||||
if ! git ls-remote --exit-code --heads origin gh-pages; then
|
|
||||||
git checkout --orphan gh-pages
|
|
||||||
git rm -rf .
|
|
||||||
git commit --allow-empty -m "Initialize gh-pages branch"
|
|
||||||
git push origin gh-pages
|
|
||||||
git checkout main
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Deploy to extra branch
|
|
||||||
uses: peaceiris/actions-gh-pages@v4
|
|
||||||
with:
|
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
publish_dir: ./dist
|
|
||||||
publish_branch: gh-pages
|
|
||||||
Loading…
Reference in a new issue