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