🐛 fix: revert to single workflow approach for Gitea Actions compatibility
This commit is contained in:
@@ -308,25 +308,54 @@ jobs:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Trigger Docker push workflow on main branch
|
# Docker push job - runs on host environment
|
||||||
trigger-docker-push:
|
docker-push:
|
||||||
name: Trigger Docker Push
|
name: Docker Push
|
||||||
needs: [build-cache, ci-pipeline]
|
needs: [build-cache, ci-pipeline]
|
||||||
runs-on: ubuntu-latest-ca
|
runs-on: ubuntu-latest-ca
|
||||||
if: "!contains(github.event.head_commit.message, '[skip ci]') && github.actor != 'ci-bot' && github.ref == 'refs/heads/main'"
|
if: "!contains(github.event.head_commit.message, '[skip ci]') && github.actor != 'ci-bot' && github.ref == 'refs/heads/main'"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Trigger Docker Push Workflow
|
- name: Checkout code
|
||||||
uses: actions/github-script@v6
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Login to Gitea Container Registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
script: |
|
registry: ${{ env.CI_REGISTRY }}
|
||||||
await github.rest.actions.createWorkflowDispatch({
|
username: ${{ github.actor }}
|
||||||
owner: 'arcodange',
|
password: ${{ secrets.PACKAGES_TOKEN }}
|
||||||
repo: 'dance-lessons-coach',
|
|
||||||
workflow_id: 'docker-push.yaml',
|
- name: Build and push Docker image
|
||||||
ref: 'main',
|
run: |
|
||||||
inputs: {
|
source VERSION
|
||||||
deps_hash: '${{ needs.build-cache.outputs.deps_hash }}',
|
IMAGE_VERSION="$MAJOR.$MINOR.$PATCH${PRERELEASE:+-$PRERELEASE}"
|
||||||
ref: 'main'
|
|
||||||
}
|
# Use the template file with proper dependency hash replacement
|
||||||
});
|
DEPS_HASH="${{ needs.build-cache.outputs.deps_hash }}"
|
||||||
|
echo "Using dependency hash: $DEPS_HASH"
|
||||||
|
|
||||||
|
# Create Dockerfile.prod from template
|
||||||
|
sed "s/{{DEPS_HASH}}/$DEPS_HASH/g" docker/Dockerfile.prod.template > docker/Dockerfile.prod
|
||||||
|
|
||||||
|
TAGS="$IMAGE_VERSION latest ${{ github.sha }}"
|
||||||
|
echo "Building Docker image with tags: $TAGS"
|
||||||
|
|
||||||
|
# Build the production image
|
||||||
|
docker build -t dance-lessons-coach -f docker/Dockerfile.prod .
|
||||||
|
|
||||||
|
for TAG in $TAGS; do
|
||||||
|
IMAGE_NAME="${{ env.CI_REGISTRY }}/${{ env.GITEA_ORG }}/${{ env.GITEA_REPO }}:$TAG"
|
||||||
|
echo "Tagging and pushing: $IMAGE_NAME"
|
||||||
|
docker tag dance-lessons-coach "$IMAGE_NAME"
|
||||||
|
docker push "$IMAGE_NAME"
|
||||||
|
done
|
||||||
|
|
||||||
|
- name: Show published images
|
||||||
|
run: |
|
||||||
|
source VERSION
|
||||||
|
IMAGE_VERSION="$MAJOR.$MINOR.$PATCH${PRERELEASE:+-$PRERELEASE}"
|
||||||
|
echo "📦 Published Docker images:"
|
||||||
|
echo " - ${{ env.CI_REGISTRY }}/${{ env.GITEA_ORG }}/${{ env.GITEA_REPO }}:$IMAGE_VERSION"
|
||||||
|
echo " - ${{ env.CI_REGISTRY }}/${{ env.GITEA_ORG }}/${{ env.GITEA_REPO }}:latest"
|
||||||
|
echo " - ${{ env.CI_REGISTRY }}/${{ env.GITEA_ORG }}/${{ env.GITEA_REPO }}:${{ github.sha }}"
|
||||||
|
|||||||
Reference in New Issue
Block a user