build(deps): Bump pino from 9.7.0 to 9.9.0 #605
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: "CI/CD: Continuous integration and continuous deployment" | |
"on": | |
push: | |
branches: | |
- main | |
tags: | |
- "v*" | |
pull_request: | |
merge_group: | |
env: | |
IMAGE_NAME_MIXEDCASE: "${{ github.repository }}" | |
TEST_STAGE: tester | |
PRODUCTION_STAGE: production | |
jobs: | |
build-check-test-push: | |
name: Build, check, test, push | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 2 | |
- name: Install Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "lts/*" | |
cache: "npm" | |
- name: Install NPM dependencies | |
run: npm ci | |
# This step considers also the files ignored in .dockerignore, such as | |
# documentation and GitHub Actions workflows. | |
- name: Check and test outside Docker | |
run: npm run check-and-build | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v5 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
- name: Upload test results to Codecov | |
if: ${{ !cancelled() }} | |
uses: codecov/test-results-action@v1 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
- name: Lowercase Docker image name | |
run: | | |
echo "IMAGE_NAME=${IMAGE_NAME_MIXEDCASE,,}" >> "${GITHUB_ENV}" | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.IMAGE_NAME }} | |
tags: | | |
type=edge,branch=main | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}},enable=${{ !startsWith(github.ref, 'refs/tags/v0.') }} | |
type=sha,format=long | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build and export to Docker | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
load: true | |
target: "${{ env.TEST_STAGE }}" | |
tags: "${{ env.IMAGE_NAME }}:${{ env.TEST_STAGE }}" | |
- name: Check and test | |
run: | | |
docker run --rm "${{ env.IMAGE_NAME }}:${{ env.TEST_STAGE }}" | |
- name: Check for uncommitted changes | |
run: | | |
if [[ -n $(git status --porcelain) ]]; then | |
echo "::error::Uncommitted changes detected!" | |
echo "The following files were modified or created:" | |
git status --porcelain | |
echo "Please either commit the changes or add them into .gitignore." | |
exit 1 | |
else | |
echo "Working directory is clean." | |
fi | |
- name: Login to Docker Hub | |
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || contains(github.ref, 'refs/tags/')) | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.TRANSITDATA_DOCKERHUB_USER }} | |
password: ${{ secrets.TRANSITDATA_DOCKERHUB_TOKEN }} | |
- name: Build and push | |
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || contains(github.ref, 'refs/tags/')) | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
push: true | |
target: "${{ env.PRODUCTION_STAGE }}" | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |