ci: detect changes and use actions/stapler-deploy
This commit is contained in:
@@ -8,6 +8,15 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- "main"
|
- "main"
|
||||||
|
paths:
|
||||||
|
- '.github/workflows/deploy.yml'
|
||||||
|
- 'package.json'
|
||||||
|
- 'bun.lock'
|
||||||
|
- 'src/**'
|
||||||
|
- 'index.html'
|
||||||
|
- 'vite.config.ts'
|
||||||
|
- 'tsconfig.*'
|
||||||
|
- 'env.d.ts'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@@ -32,18 +41,16 @@ jobs:
|
|||||||
name: "Deploy to Stapler"
|
name: "Deploy to Stapler"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: build
|
needs: build
|
||||||
if: ${{ vars.STAPLER_TARGET != '' }}
|
|
||||||
steps:
|
steps:
|
||||||
- name: Download production files
|
- name: Download production files
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: production-files
|
name: production-files
|
||||||
path: ./dist
|
path: ./dist
|
||||||
- name: Compress production files
|
|
||||||
run: tar -czC dist -f dist.tar.gz .
|
|
||||||
- name: Upload to Stapler server
|
- name: Upload to Stapler server
|
||||||
run: |
|
uses: actions/stapler-deploy@v1
|
||||||
curl -s -X PUT --fail-with-body --data-binary "@dist.tar.gz" \
|
with:
|
||||||
-H 'X-Token: ${{ secrets.STAPLER_TOKEN }}' \
|
path: dist
|
||||||
${{ vars.STAPLER_CURL_ARGS }} \
|
token: ${{ secrets.STAPLER_TOKEN }}
|
||||||
${{ vars.STAPLER_TARGET }}
|
target: ${{ github.repository }}
|
||||||
|
extra_curl_args: ${{ vars.STAPLER_CURL_ARGS }}
|
||||||
|
|||||||
@@ -4,7 +4,18 @@ concurrency:
|
|||||||
group: lint-${{ github.ref }}
|
group: lint-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
on: [push, workflow_dispatch]
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- '.github/workflows/lint.yml'
|
||||||
|
- 'package.json'
|
||||||
|
- 'bun.lock'
|
||||||
|
- 'src/**'
|
||||||
|
- '.oxlintrc.json'
|
||||||
|
- 'eslint.config.ts'
|
||||||
|
- 'tsconfig.*'
|
||||||
|
- 'env.d.ts'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint-eslint:
|
lint-eslint:
|
||||||
|
|||||||
Reference in New Issue
Block a user