ci: deploy website from Forgejo Actions
This commit is contained in:
parent
29077923e8
commit
96fe4d26c7
3 changed files with 402 additions and 0 deletions
72
.forgejo/workflows/dimensionlab-website.yml
Normal file
72
.forgejo/workflows/dimensionlab-website.yml
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
name: Dimension Lab website
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types:
|
||||
- opened
|
||||
- synchronize
|
||||
- reopened
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: dimensionlab-website-${{ github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
|
||||
|
||||
jobs:
|
||||
ci:
|
||||
runs-on: docker
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: https://data.forgejo.org/actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
submodules: false
|
||||
|
||||
- name: Initialize submodules
|
||||
run: |
|
||||
git config --global url."https://git.dimensionlab.net/".insteadOf "ssh://git@git.dimensionlab.net/"
|
||||
git submodule update --init --recursive
|
||||
|
||||
- name: Install Bun
|
||||
run: |
|
||||
curl -fsSL https://bun.sh/install | bash -s "bun-v1.3.14"
|
||||
"$HOME/.bun/bin/bun" --version
|
||||
|
||||
- name: Check, test, and build
|
||||
run: |
|
||||
export BUN_INSTALL="$HOME/.bun"
|
||||
export PATH="$BUN_INSTALL/bin:$PATH"
|
||||
bun install --frozen-lockfile
|
||||
bun run check
|
||||
bun run test
|
||||
bun run build
|
||||
|
||||
deploy:
|
||||
needs: ci
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||
runs-on: docker
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: https://data.forgejo.org/actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
submodules: false
|
||||
|
||||
- name: Initialize submodules
|
||||
run: |
|
||||
git config --global url."https://git.dimensionlab.net/".insteadOf "ssh://git@git.dimensionlab.net/"
|
||||
git submodule update --init --recursive
|
||||
|
||||
- name: Deploy production website
|
||||
env:
|
||||
DEPLOY_CONTAINER_CLI: docker
|
||||
DEPLOY_EVENT_NAME: ${{ github.event_name }}
|
||||
DEPLOY_REF: ${{ github.ref }}
|
||||
DEPLOY_RESTART_STRATEGY: kill-container
|
||||
DEPLOY_SHA: ${{ github.sha }}
|
||||
run: scripts/deploy-dimensionlab-website.sh
|
||||
Loading…
Add table
Add a link
Reference in a new issue