Fix CI workflow to use github context variables.
The ChristopherHX runner only supports github.* expressions, not gitea.*. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -20,16 +20,15 @@ jobs:
|
||||
- name: Image tags
|
||||
id: meta
|
||||
run: |
|
||||
short_sha="${GITEA_SHA:-${GITHUB_SHA}}"
|
||||
short_sha="${short_sha:0:7}"
|
||||
short_sha="${GITHUB_SHA:0:7}"
|
||||
echo "short_sha=${short_sha}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
{
|
||||
echo "tags<<EOF"
|
||||
echo "${IMAGE}:latest"
|
||||
echo "${IMAGE}:sha-${short_sha}"
|
||||
if [ "${GITEA_REF_TYPE:-${GITHUB_REF_TYPE}}" = "tag" ]; then
|
||||
ref_name="${GITEA_REF_NAME:-${GITHUB_REF_NAME}}"
|
||||
if [ "${GITHUB_REF_TYPE}" = "tag" ]; then
|
||||
ref_name="${GITHUB_REF_NAME}"
|
||||
echo "${IMAGE}:${ref_name}"
|
||||
echo "${IMAGE}:${ref_name#v}"
|
||||
fi
|
||||
@@ -37,11 +36,8 @@ jobs:
|
||||
} >> "$GITHUB_OUTPUT"
|
||||
env:
|
||||
IMAGE: ${{ env.IMAGE }}
|
||||
GITEA_SHA: ${{ gitea.sha }}
|
||||
GITHUB_SHA: ${{ github.sha }}
|
||||
GITEA_REF_TYPE: ${{ gitea.ref_type }}
|
||||
GITHUB_REF_TYPE: ${{ github.ref_type }}
|
||||
GITEA_REF_NAME: ${{ gitea.ref_name }}
|
||||
GITHUB_REF_NAME: ${{ github.ref_name }}
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
@@ -51,7 +47,7 @@ jobs:
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ gitea.actor }}
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||
|
||||
- name: Build and push
|
||||
@@ -63,7 +59,7 @@ jobs:
|
||||
|
||||
release:
|
||||
needs: build-and-push
|
||||
if: gitea.ref_type == 'tag' || github.ref_type == 'tag'
|
||||
if: github.ref_type == 'tag'
|
||||
runs-on: self-hosted
|
||||
steps:
|
||||
- name: Checkout
|
||||
@@ -75,18 +71,18 @@ jobs:
|
||||
NODE_OPTIONS: "--experimental-fetch"
|
||||
with:
|
||||
token: ${{ secrets.REGISTRY_TOKEN }}
|
||||
tag_name: ${{ gitea.ref_name }}
|
||||
name: Conflict Checker ${{ gitea.ref_name }}
|
||||
tag_name: ${{ github.ref_name }}
|
||||
name: Conflict Checker ${{ github.ref_name }}
|
||||
body: |
|
||||
## Docker
|
||||
|
||||
```bash
|
||||
docker login gitea.scoutitsystems.com
|
||||
docker pull gitea.scoutitsystems.com/woogi/conflict-checker:${{ gitea.ref_name }}
|
||||
docker pull gitea.scoutitsystems.com/woogi/conflict-checker:${{ github.ref_name }}
|
||||
```
|
||||
|
||||
Deploy on a host (with `docker-compose.prod.yml` and `backend/.env`):
|
||||
|
||||
```bash
|
||||
IMAGE_TAG=${{ gitea.ref_name }} docker compose -f docker-compose.prod.yml up -d
|
||||
IMAGE_TAG=${{ github.ref_name }} docker compose -f docker-compose.prod.yml up -d
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user