ci(git): deploy
This commit is contained in:
2 files changed
+58
-46
No files matched your search
@@ -1,46 +0,0 @@
|
|||||||
name: CI
|
|
||||||
|
|
||||||
on: [push]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
eslint:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- uses: oven-sh/setup-bun@v2
|
|
||||||
with:
|
|
||||||
bun-version: latest
|
|
||||||
- name: Install modules
|
|
||||||
run: bun ci
|
|
||||||
- name: Run ESLint
|
|
||||||
run: bun run lint
|
|
||||||
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- uses: oven-sh/setup-bun@v2
|
|
||||||
with:
|
|
||||||
bun-version: latest
|
|
||||||
- name: Install modules
|
|
||||||
run: bun ci
|
|
||||||
- name: Build site
|
|
||||||
run: bun run build
|
|
||||||
- name: Upload static files as artifact
|
|
||||||
uses: actions/upload-pages-artifact@v3
|
|
||||||
with:
|
|
||||||
path: dist/
|
|
||||||
|
|
||||||
deploy:
|
|
||||||
environment:
|
|
||||||
name: github-pages
|
|
||||||
url: ${{ steps.deployment.outputs.page_url }}
|
|
||||||
permissions:
|
|
||||||
pages: write
|
|
||||||
id-token: write
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: build
|
|
||||||
steps:
|
|
||||||
- name: Deploy to GitHub Pages
|
|
||||||
id: deployment
|
|
||||||
uses: actions/deploy-pages@v4
|
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
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'
|
||||||
|
- 'tsconfig.*'
|
||||||
|
- 'env.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
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
- name: Install dependencies
|
||||||
|
run: bun ci
|
||||||
|
- 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 }}
|
||||||
Reference in new issue
Block a user