66 lines
1.5 KiB
YAML
66 lines
1.5 KiB
YAML
name: Deploy
|
|
|
|
concurrency:
|
|
group: deploy-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- "main"
|
|
paths:
|
|
- '.github/workflows/deploy.yml'
|
|
- 'package.json'
|
|
- 'bun.lock'
|
|
- 'src/**'
|
|
- 'index.html'
|
|
- 'vite.config.ts'
|
|
- 'post-build.ts'
|
|
- 'tsconfig.*'
|
|
- 'env.d.ts'
|
|
- 'vite.d.ts'
|
|
|
|
jobs:
|
|
build:
|
|
name: "Build"
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Set up Bun
|
|
uses: actions/setup-bun@v2
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v6
|
|
- name: Install dependencies
|
|
run: bun ci
|
|
- name: Checkout articles repository
|
|
uses: actions/checkout@v6
|
|
with:
|
|
repository: ${{ vars.ARTICLES_REPOSITORY }}
|
|
ref: main
|
|
token: ${{ secrets.PRIVATE_CLONE_TOKEN }}
|
|
path: ./articles
|
|
- name: Build project
|
|
run: bun run build
|
|
- name: Upload production files
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: production-files
|
|
path: dist/
|
|
|
|
stapler:
|
|
name: "Deploy to Stapler"
|
|
runs-on: ubuntu-latest
|
|
needs: build
|
|
steps:
|
|
- name: Download production files
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: production-files
|
|
path: ./dist
|
|
- name: Upload to Stapler server
|
|
uses: actions/stapler-deploy@v1
|
|
with:
|
|
path: dist
|
|
token: ${{ secrets.STAPLER_TOKEN }}
|
|
target: ${{ github.repository }}
|
|
extra_curl_args: ${{ vars.STAPLER_CURL_ARGS }}
|