Compare commits
7 Commits
c613330968
...
dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
beada81079 | ||
|
|
0f9b75f8e4 | ||
|
|
92d7293612 | ||
|
|
cfa1cb6726 | ||
|
|
9747d65eda | ||
|
|
42243e4b28 | ||
|
|
9bc87ad1f5 |
@@ -1,9 +1,6 @@
|
|||||||
name: CI/CD Test
|
name: CI/CD Test
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
@@ -12,8 +9,8 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-deploy:
|
build-deploy:
|
||||||
runs-on: self-hosted
|
runs-on: act_runner_base
|
||||||
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.merged == true }}
|
if: ${{ github.event.pull_request.merged == true }}
|
||||||
steps:
|
steps:
|
||||||
- name: Set up environment
|
- name: Set up environment
|
||||||
run: |
|
run: |
|
||||||
@@ -30,3 +27,35 @@ 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