ci: use scp/ssh instead of upload-artifact for Gitea Actions compatibility #6

Merged
zihluwang merged 1 commits from develop into main 2026-06-16 01:36:08 +08:00
+20 -25
View File
@@ -30,12 +30,15 @@ jobs:
- name: Build release archive - name: Build release archive
run: pnpm build:tar run: pnpm build:tar
- name: Upload build artifact - name: Upload artifact to server
uses: actions/upload-artifact@v4 uses: appleboy/scp-action@v0.1.7
with: with:
name: dist-archive host: ${{ vars.DEPLOY_HOST }}
path: dist.tar.gz username: ${{ vars.DEPLOY_USER }}
retention-days: 1 port: ${{ vars.DEPLOY_PORT }}
key: ${{ secrets.DEPLOY_SSH_KEY }}
source: "dist.tar.gz"
target: "/tmp/dist.tar.gz"
upload-release-asset: upload-release-asset:
name: Upload to Gitea Release name: Upload to Gitea Release
@@ -43,16 +46,23 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Download build artifact - name: Download artifact from server
uses: actions/download-artifact@v4 uses: appleboy/ssh-action@v1.0.3
with: with:
name: dist-archive host: ${{ vars.DEPLOY_HOST }}
username: ${{ vars.DEPLOY_USER }}
port: ${{ vars.DEPLOY_PORT }}
key: ${{ secrets.DEPLOY_SSH_KEY }}
command: |
set -e
mkdir -p ~/.cache/gitea-artifacts
cp /tmp/dist.tar.gz ~/.cache/gitea-artifacts/
- name: Upload release asset - name: Upload release asset
uses: https://gitea.com/actions/forgejo-release@v1 uses: https://gitea.com/actions/forgejo-release@v1
with: with:
direction: upload direction: upload
files: dist.tar.gz files: ~/.cache/gitea-artifacts/dist.tar.gz
env: env:
FORGEJO_TOKEN: ${{ secrets.GITEA_TOKEN }} FORGEJO_TOKEN: ${{ secrets.GITEA_TOKEN }}
@@ -62,22 +72,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Download build artifact - name: Extract archive and deploy
uses: actions/download-artifact@v4
with:
name: dist-archive
- name: Upload archive to server
uses: appleboy/scp-action@v0.1.7
with:
host: ${{ vars.DEPLOY_HOST }}
username: ${{ vars.DEPLOY_USER }}
port: ${{ vars.DEPLOY_PORT }}
key: ${{ secrets.DEPLOY_SSH_KEY }}
source: "dist.tar.gz"
target: "/tmp/"
- name: Extract archive and set ownership
uses: appleboy/ssh-action@v1.0.3 uses: appleboy/ssh-action@v1.0.3
with: with:
host: ${{ vars.DEPLOY_HOST }} host: ${{ vars.DEPLOY_HOST }}