tryfix
Some checks failed
Build and Deploy Versioned Spring Boot Server / build (push) Has been cancelled
Some checks failed
Build and Deploy Versioned Spring Boot Server / build (push) Has been cancelled
This commit is contained in:
47
.gitea/workflows/tag_debug.yml
Normal file
47
.gitea/workflows/tag_debug.yml
Normal file
@@ -0,0 +1,47 @@
|
||||
name: Build and Deploy Versioned Spring Boot Server
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "*" # Match all tags
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
# 1. Checkout the code
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
# 2. Debug Environment Variables
|
||||
- name: Debug Environment Variables
|
||||
run: env
|
||||
|
||||
# 3. Extract the tag name
|
||||
- name: Extract Tag Version
|
||||
id: extract_version
|
||||
run: |
|
||||
echo "GITEA_REF=${GITEA_REF}" # Debugging output
|
||||
TAG_VERSION=$(echo "${GITEA_REF}" | sed 's#refs/tags/##')
|
||||
if [ -z "$TAG_VERSION" ]; then
|
||||
echo "Error: TAG_VERSION is empty. GITEA_REF=${GITEA_REF}"
|
||||
exit 1
|
||||
fi
|
||||
echo "TAG_VERSION=$TAG_VERSION" >> $GITHUB_ENV
|
||||
echo "Extracted TAG_VERSION: $TAG_VERSION"
|
||||
|
||||
# 4. Build and Package Docker Image
|
||||
- name: Build and Package Docker Image
|
||||
run: |
|
||||
docker build -t tea.zendric.de/cedric/xpensely-server:${{ env.TAG_VERSION }} .
|
||||
|
||||
# 5. Docker login
|
||||
- name: Login to Docker Registry
|
||||
run: |
|
||||
echo "${{ secrets.TEAPASSWORD }}" | docker login tea.zendric.de -u ${{ secrets.TEAUSER }} --password-stdin
|
||||
|
||||
# 6. Push the Docker image with the tag
|
||||
- name: Push the Docker Image to registry
|
||||
run: |
|
||||
docker push tea.zendric.de/cedric/xpensely-server:${{ env.TAG_VERSION }}
|
||||
Reference in New Issue
Block a user