ci: update deploy ci for gitea
This commit is contained in:
@@ -1,39 +1,41 @@
|
|||||||
name: Deploy
|
name: Deploy
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: deploy-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
on:
|
on:
|
||||||
schedule:
|
push:
|
||||||
- cron: "*/30 * * * *"
|
branches:
|
||||||
push:
|
- 'main'
|
||||||
branches:
|
|
||||||
- "main"
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: Build
|
runs-on: ubuntu-latest
|
||||||
runs-on: ubuntu-latest
|
steps:
|
||||||
steps:
|
- uses: https://github.com/oven-sh/setup-bun@v2
|
||||||
- uses: actions/checkout@v6
|
with:
|
||||||
- uses: oven-sh/setup-bun@v2
|
bun-version: latest
|
||||||
- run: bun install
|
- uses: actions/checkout@v6
|
||||||
- name: Setup SSH Key
|
- run: bun ci
|
||||||
uses: webfactory/ssh-agent@v0.9.1
|
- run: bun run build
|
||||||
with:
|
- uses: actions/upload-artifact@v3
|
||||||
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
|
with:
|
||||||
- run: git clone ${{ vars.ARTICLES_REPOSITORY }} articles
|
name: production-files
|
||||||
- run: bun run build
|
path: dist/
|
||||||
- uses: actions/upload-artifact@v7
|
|
||||||
with:
|
deploy:
|
||||||
name: production-files
|
runs-on: ubuntu-latest
|
||||||
path: ./dist
|
needs: build
|
||||||
deploy:
|
if: ${{ vars.STAPLER_TARGET != '' }}
|
||||||
name: Deploy
|
steps:
|
||||||
needs: build
|
- uses: actions/download-artifact@v3
|
||||||
runs-on: ubuntu-latest
|
with:
|
||||||
steps:
|
name: production-files
|
||||||
- uses: actions/download-artifact@v8
|
path: ./dist
|
||||||
with:
|
- run: tar -czC dist -f dist.tar.gz .
|
||||||
name: production-files
|
- run: |
|
||||||
path: ./dist
|
curl -s -X PUT --data-binary "@dist.tar.gz" \
|
||||||
- run: tar -czC dist -f dist.tar.gz .
|
-H 'X-Token: ${{ secrets.STAPLER_TOKEN }}' \
|
||||||
- run: |
|
${{ vars.STAPLER_CURL_ARGS }} \
|
||||||
curl -v -X PUT -H 'X-Token: ${{ secrets.STAPLER_TOKEN }}' -H 'X-Host-Only: ${{ vars.TARGET_HOST }}' -H 'X-SPA: index.html' --data-binary "@dist.tar.gz" ${{ vars.STAPLER_TARGET }}
|
${{ vars.STAPLER_TARGET }}
|
||||||
|
|||||||
Reference in New Issue
Block a user