fix: skip release steps if no version bump commit was made
Pull Request / unit-tests (pull_request) Successful in 2m4s
Pull Request / acceptance-tests (pull_request) Failing after 2m17s
Pull Request / analyze-bump-type (pull_request) Has been skipped
Test / unit-tests (push) Successful in 2m38s
Release / release (push) Failing after 7m25s
Pull Request / unit-tests (pull_request) Successful in 2m4s
Pull Request / acceptance-tests (pull_request) Failing after 2m17s
Pull Request / analyze-bump-type (pull_request) Has been skipped
Test / unit-tests (push) Successful in 2m38s
Release / release (push) Failing after 7m25s
- Set output variable 'committed' in commit step - Add conditional execution to all subsequent steps - Only create tag, build Docker images, and deploy if commit was successful
This commit was merged in pull request #19.
This commit is contained in:
@@ -78,16 +78,20 @@ jobs:
|
||||
echo "New version: $NEW_VERSION"
|
||||
|
||||
- name: Commit version bump
|
||||
id: commit
|
||||
run: |
|
||||
git add package.json CHANGELOG.md
|
||||
if git diff --cached --quiet; then
|
||||
echo "No changes to commit (version may already be at target version)"
|
||||
echo "committed=false" >> $GITHUB_OUTPUT
|
||||
else
|
||||
git commit -m "chore: bump version to v${{ steps.version.outputs.new_version }}"
|
||||
git push origin main
|
||||
echo "committed=true" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Create git tag for release
|
||||
if: steps.commit.outputs.committed == 'true'
|
||||
run: |
|
||||
TAG_NAME="v${{ steps.version.outputs.new_version }}"
|
||||
echo "Creating tag $TAG_NAME"
|
||||
@@ -101,9 +105,11 @@ jobs:
|
||||
fi
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
if: steps.commit.outputs.committed == 'true'
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Build test-capable image
|
||||
if: steps.commit.outputs.committed == 'true'
|
||||
run: |
|
||||
docker build \
|
||||
--target test-runner \
|
||||
@@ -112,6 +118,7 @@ jobs:
|
||||
.
|
||||
|
||||
- name: Run tests inside test-capable container
|
||||
if: steps.commit.outputs.committed == 'true'
|
||||
run: |
|
||||
docker run --rm \
|
||||
-e DATABASE_URL="postgresql://user:pass@localhost:5432/dummy" \
|
||||
@@ -119,6 +126,7 @@ jobs:
|
||||
npm run test:run
|
||||
|
||||
- name: Build production image
|
||||
if: steps.commit.outputs.committed == 'true'
|
||||
run: |
|
||||
docker build \
|
||||
--target runner \
|
||||
@@ -128,6 +136,7 @@ jobs:
|
||||
.
|
||||
|
||||
- name: Push Docker images
|
||||
if: steps.commit.outputs.committed == 'true'
|
||||
run: |
|
||||
echo "Pushing to ${{ env.REGISTRY }}..."
|
||||
# Check if we can authenticate to the registry using DOCKER_LOGIN and DOCKER_PASSWORD secrets
|
||||
@@ -152,6 +161,7 @@ jobs:
|
||||
fi
|
||||
|
||||
- name: Deploy to dev (placeholder)
|
||||
if: steps.commit.outputs.committed == 'true'
|
||||
run: |
|
||||
echo "Deploying version ${{ steps.version.outputs.new_version }} to dev environment..."
|
||||
# TODO: Add actual deployment steps
|
||||
|
||||
Reference in New Issue
Block a user