Compare commits
10 Commits
50144f57bf
...
ci-10
| Author | SHA1 | Date | |
|---|---|---|---|
| e7924d7f14 | |||
| 0f9b75f8e4 | |||
| a612b01059 | |||
| 92d7293612 | |||
| 7cd6aa6a3c | |||
| cfa1cb6726 | |||
| 46b1d26800 | |||
| 9747d65eda | |||
| 982eeb25db | |||
| 42243e4b28 |
@ -9,8 +9,8 @@ on:
|
||||
|
||||
jobs:
|
||||
build-deploy:
|
||||
runs-on: act_runner
|
||||
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.merged == true }}
|
||||
runs-on: act_runner_base
|
||||
if: ${{ github.event.pull_request.merged == true }}
|
||||
steps:
|
||||
- name: Set up environment
|
||||
run: |
|
||||
@ -27,3 +27,35 @@ jobs:
|
||||
if: success()
|
||||
run: |
|
||||
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' }}
|
||||
steps:
|
||||
- name: Create release
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.RUNNER_TOKEN }}
|
||||
GITEA_SERVER_URL: ${{ github.server_url }}
|
||||
GITEA_REPOSITORY: ${{ github.repository }}
|
||||
RELEASE_TAG: ci-${{ github.run_id }}
|
||||
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