Conversation
…igger docker build workflow on tag pushed
Adding `git tag` to the release flow
There was a problem hiding this comment.
Pull request overview
This pull request modernizes the Docker workflow to use tag-based publishing instead of branch-based publishing, and updates the production deployment to use PM2 clustering via docker-compose. The changes align the release process with semantic versioning practices and ensure production deployments use process management for better reliability.
Changes:
- GitHub Actions workflow now triggers on version tags (
v*.*.*) instead of every push to main, usingdocker/metadata-actionfor automated semver tagging - Added
prodscript to package.json usingpm2-runtimefor clustered production deployment - Added
postversionscript to automatically push version commits and tags after version bumps - Updated docker-compose.yml to use the new
prodscript for production startup
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
.github/workflows/docker-publish.yml |
Switched from branch-based to tag-based Docker publishing, upgraded to docker/build-push-action@v6, and implemented docker/metadata-action for automatic semver tagging |
package.json |
Added prod script with pm2-runtime clustering and postversion hook for automatic git push |
docker-compose.yml |
Changed frontend service command to use npm run prod for production deployment with PM2 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - name: Extract Docker metadata | ||
| id: meta | ||
| uses: docker/metadata-action@v5 | ||
| with: | ||
| images: ghcr.io/eosc-data-commons/matchmaker-frontend | ||
| tags: | | ||
| type=semver,pattern={{version}} | ||
| type=semver,pattern={{major}}.{{minor}} | ||
| type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/') }} | ||
|
|
||
| - name: Build and push Docker image | ||
| uses: docker/build-push-action@v5 | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| context: . | ||
| platforms: linux/amd64,linux/arm64 | ||
| push: true | ||
| tags: | | ||
| ghcr.io/eosc-data-commons/matchmaker-frontend:latest | ||
| ghcr.io/eosc-data-commons/matchmaker-frontend:${{ steps.get_version.outputs.version }} | ||
| tags: ${{ steps.meta.outputs.tags }} | ||
| labels: ${{ steps.meta.outputs.labels }} |
There was a problem hiding this comment.
workflow_dispatch can run this workflow on a branch ref, but the metadata action is configured to generate tags only from semver tags (and latest is explicitly disabled on non-tag refs). In that scenario steps.meta.outputs.tags will be empty and the build/push step will fail (or push nothing). Consider either removing workflow_dispatch, or adding a non-tag fallback tag (e.g., sha/ref-based) and/or guarding the push step so it only runs for tag refs.
| "eslint": "^9.19.0", | ||
| "eslint-plugin-react-hooks": "^7.0.1", | ||
| "eslint-plugin-react-refresh": "^0.5.0", | ||
| "globals": "^17.3.0", | ||
| "tailwindcss": "^4.1.17", | ||
| "tsx": "^4.21.0", | ||
| "typescript": "~5.9.3", | ||
| "typescript-eslint": "^8.55.0", | ||
| "typescript-eslint": "^8.36.0", | ||
| "vite": "7.3.1" | ||
| }, | ||
| "overrides": { | ||
| "minimatch": "^10.2.1" |
There was a problem hiding this comment.
This PR is described as a Docker workflow/startup change, but this hunk also changes lint tooling versions and adds an overrides entry (which cascades into a large package-lock.json update). If those dependency/tooling changes are intentional, they should be called out explicitly in the PR description/changelog; otherwise consider reverting them or splitting them into a separate PR to keep the release-focused Docker changes isolated.
This pull request updates the Docker build and deployment workflow, improves Docker image tagging, and adjusts the production startup commands for the frontend service. The main goals are to streamline Docker image publishing based on tags, enhance metadata handling, and ensure the production environment uses the correct process manager.
Workflow and Docker image publishing improvements:
.github/workflows/docker-publish.ymlis now triggered on new version tags (matchingv*.*.*) instead of every push tomain, ensuring Docker images are only built and published for releases.package.jsonto using thedocker/metadata-action, which automatically handles image tagging (includinglatest, full semver, and major.minor tags) and metadata extraction.docker/build-push-action@v6and to apply tags and labels generated by the metadata action, improving consistency and automation in image publishing.Production startup and development workflow changes:
docker-compose.yml, the frontend service now usesnpm run prodas its command, ensuring the service starts in production mode using the correct process manager.prodscript topackage.jsonthat usespm2-runtimeto run the production server with clustering, replacing the previousclusterscript.postversionscript topackage.jsonto automatically push commits and tags after version bumps, supporting a smoother release workflow.