Compare commits
4 Commits
dev
...
982eeb25db
| Author | SHA1 | Date | |
|---|---|---|---|
| 982eeb25db | |||
| 50144f57bf | |||
| c613330968 | |||
| c96c718c0c |
@@ -9,8 +9,8 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-deploy:
|
build-deploy:
|
||||||
runs-on: act_runner_base
|
runs-on: self-hosted
|
||||||
if: ${{ github.event.pull_request.merged == true }}
|
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.merged == true }}
|
||||||
steps:
|
steps:
|
||||||
- name: Set up environment
|
- name: Set up environment
|
||||||
run: |
|
run: |
|
||||||
@@ -27,35 +27,3 @@ jobs:
|
|||||||
if: success()
|
if: success()
|
||||||
run: |
|
run: |
|
||||||
echo "Deploying to production..."
|
echo "Deploying to production..."
|
||||||
create-release:
|
|
||||||
runs-on: act_runner_base
|
|
||||||
needs: build-deploy
|
|
||||||
if: ${{ success() && github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'master' && startsWith(github.event.pull_request.title, 'v') }}
|
|
||||||
steps:
|
|
||||||
- name: Create release
|
|
||||||
env:
|
|
||||||
GITEA_TOKEN: ${{ secrets.RUNNER_TOKEN }}
|
|
||||||
GITEA_SERVER_URL: ${{ github.server_url }}
|
|
||||||
GITEA_REPOSITORY: ${{ github.repository }}
|
|
||||||
RELEASE_TAG: ${{ github.event.pull_request.title }}
|
|
||||||
RELEASE_TARGET: ${{ github.sha }}
|
|
||||||
run: |
|
|
||||||
if [ -z "$GITEA_TOKEN" ]; then
|
|
||||||
echo "Missing secrets.RUNNER_TOKEN"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
api_url="$GITEA_SERVER_URL/api/v1/repos/$GITEA_REPOSITORY/releases"
|
|
||||||
payload=$(cat <<EOF
|
|
||||||
{
|
|
||||||
"tag_name": "$RELEASE_TAG",
|
|
||||||
"name": "$RELEASE_TAG",
|
|
||||||
"target_commitish": "$RELEASE_TARGET",
|
|
||||||
"draft": false,
|
|
||||||
"prerelease": false
|
|
||||||
}
|
|
||||||
EOF
|
|
||||||
)
|
|
||||||
curl -sS -X POST "$api_url" \
|
|
||||||
-H "Authorization: token $GITEA_TOKEN" \
|
|
||||||
-H "Content-Type: application/json" \
|
|
||||||
-d "$payload"
|
|
||||||
|
|||||||
Reference in New Issue
Block a user