ci: detect changes and use actions/stapler-deploy
This commit is contained in:
@@ -8,6 +8,15 @@ 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:
|
||||
@@ -15,7 +24,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Set up Bun
|
||||
uses: https://github.com/oven-sh/setup-bun@v2
|
||||
uses: actions/setup-bun@v2
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v6
|
||||
- name: Install dependencies
|
||||
@@ -32,18 +41,16 @@ jobs:
|
||||
name: "Deploy to Stapler"
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
if: ${{ vars.STAPLER_TARGET != '' }}
|
||||
steps:
|
||||
- name: Download production files
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: production-files
|
||||
path: ./dist
|
||||
- name: Compress production files
|
||||
run: tar -czC dist -f dist.tar.gz .
|
||||
- name: Upload to Stapler server
|
||||
run: |
|
||||
curl -s -X PUT --fail-with-body --data-binary "@dist.tar.gz" \
|
||||
-H 'X-Token: ${{ secrets.STAPLER_TOKEN }}' \
|
||||
${{ vars.STAPLER_CURL_ARGS }} \
|
||||
${{ vars.STAPLER_TARGET }}
|
||||
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