forgejo: deploy to $branch-testing when PR is a WIP
This commit is contained in:
parent
77dc41c8aa
commit
b76dd8bfbb
3 changed files with 17 additions and 2 deletions
|
@ -14,6 +14,10 @@ for apk in $apkgs; do
|
|||
arch=$(echo $apk | awk -F '/' '{print $3}')
|
||||
name=$(echo $apk | awk -F '/' '{print $4}')
|
||||
|
||||
if [ "$(curl -s $GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/pulls/$GITHUB_EVENT_NUMBER | jq .draft)" == "true" ]; then
|
||||
branch="$branch-testing"
|
||||
fi
|
||||
|
||||
echo "Sending $name of arch $arch to $TARGET_REPO/$BASEBRANCH/$branch"
|
||||
return=$(curl -s --user $FORGE_REPO_USER:$FORGE_REPO_TOKEN --upload-file $apk $TARGET_REPO/$BASEBRANCH/$branch 2>&1)
|
||||
echo $return
|
||||
|
|
|
@ -2,6 +2,10 @@ on:
|
|||
pull_request:
|
||||
types: [ assigned, opened, synchronize, reopened ]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.head_ref || github.ref_name }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build-aarch64:
|
||||
runs-on: aarch64
|
||||
|
@ -41,9 +45,10 @@ jobs:
|
|||
CI_ALPINE_REPO: 'https://ayakael.net/api/packages/forge/alpine'
|
||||
FORGE_REPO_TOKEN: ${{ secrets.FORGE_REPO_TOKEN }}
|
||||
FORGE_REPO_USER: ${{ vars.FORGE_REPO_USER }}
|
||||
GITHUB_EVENT_NUMBER: ${{ github.event.number }}
|
||||
steps:
|
||||
- name: Setting up environment
|
||||
run: apk add nodejs curl findutils git gawk
|
||||
run: apk add nodejs curl findutils git gawk jq
|
||||
- name: Repo pull
|
||||
uses: actions/checkout@v4
|
||||
- name: Package download
|
||||
|
|
|
@ -2,6 +2,10 @@ on:
|
|||
pull_request:
|
||||
types: [ assigned, opened, synchronize, reopened ]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.head_ref || github.ref_name }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build-x86_64:
|
||||
runs-on: x86_64
|
||||
|
@ -41,12 +45,14 @@ jobs:
|
|||
CI_ALPINE_REPO: 'https://ayakael.net/api/packages/forge/alpine'
|
||||
FORGE_REPO_TOKEN: ${{ secrets.FORGE_REPO_TOKEN }}
|
||||
FORGE_REPO_USER: ${{ vars.FORGE_REPO_USER }}
|
||||
GITHUB_EVENT_NUMBER: ${{ github.event.number }}
|
||||
steps:
|
||||
- name: Setting up environment
|
||||
run: apk add nodejs curl findutils git gawk
|
||||
run: apk add nodejs curl findutils git gawk jq
|
||||
- name: Repo pull
|
||||
uses: actions/checkout@v4
|
||||
- name: Package download
|
||||
uses: forgejo/download-artifact@v3
|
||||
- name: Package deployment
|
||||
run: ${{ github.workspace }}/.forgejo/bin/deploy.sh
|
||||
|
||||
|
|
Loading…
Reference in a new issue