Files
tasknote/.github/workflows/pr-client.yml
T
rmcamposGitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>snyk-bot
c0667c0970 feat: versions (#709)
* build(deps): bump org.jacoco:jacoco-maven-plugin in /server

Bumps [org.jacoco:jacoco-maven-plugin](https://github.com/jacoco/jacoco) from 0.8.13 to 0.8.14.
- [Release notes](https://github.com/jacoco/jacoco/releases)
- [Commits](https://github.com/jacoco/jacoco/compare/v0.8.13...v0.8.14)

---
updated-dependencies:
- dependency-name: org.jacoco:jacoco-maven-plugin
  dependency-version: 0.8.14
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix: client/Dockerfile to reduce vulnerabilities

The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-ALPINE320-OPENSSL-13174134
- https://snyk.io/vuln/SNYK-ALPINE320-OPENSSL-13174135
- https://snyk.io/vuln/SNYK-ALPINE320-OPENSSL-13174135
- https://snyk.io/vuln/SNYK-ALPINE320-OPENSSL-13174136
- https://snyk.io/vuln/SNYK-ALPINE320-OPENSSL-13174136

* build(deps): bump actions/setup-node from 5 to 6

Bumps [actions/setup-node](https://github.com/actions/setup-node) from 5 to 6.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix: server/Dockerfile to reduce vulnerabilities

The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-DEBIAN12-PERL-5489190
- https://snyk.io/vuln/SNYK-DEBIAN12-ZLIB-6008963
- https://snyk.io/vuln/SNYK-DEBIAN12-PAM-10378969
- https://snyk.io/vuln/SNYK-DEBIAN12-PAM-10378969
- https://snyk.io/vuln/SNYK-DEBIAN12-PAM-10378969

* build(deps): bump org.springframework.boot:spring-boot-starter-parent

Bumps [org.springframework.boot:spring-boot-starter-parent](https://github.com/spring-projects/spring-boot) from 3.5.6 to 3.5.7.
- [Release notes](https://github.com/spring-projects/spring-boot/releases)
- [Commits](https://github.com/spring-projects/spring-boot/compare/v3.5.6...v3.5.7)

---
updated-dependencies:
- dependency-name: org.springframework.boot:spring-boot-starter-parent
  dependency-version: 3.5.7
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): bump com.puppycrawl.tools:checkstyle in /server

Bumps [com.puppycrawl.tools:checkstyle](https://github.com/checkstyle/checkstyle) from 11.1.0 to 12.1.1.
- [Release notes](https://github.com/checkstyle/checkstyle/releases)
- [Commits](https://github.com/checkstyle/checkstyle/compare/checkstyle-11.1.0...checkstyle-12.1.1)

---
updated-dependencies:
- dependency-name: com.puppycrawl.tools:checkstyle
  dependency-version: 12.1.1
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): bump org.hibernate.orm.tooling:hibernate-enhance-maven-plugin

Bumps [org.hibernate.orm.tooling:hibernate-enhance-maven-plugin](https://github.com/hibernate/hibernate-orm) from 6.6.31.Final to 6.6.34.Final.
- [Release notes](https://github.com/hibernate/hibernate-orm/releases)
- [Changelog](https://github.com/hibernate/hibernate-orm/blob/6.6.34/changelog.txt)
- [Commits](https://github.com/hibernate/hibernate-orm/compare/6.6.31...6.6.34)

---
updated-dependencies:
- dependency-name: org.hibernate.orm.tooling:hibernate-enhance-maven-plugin
  dependency-version: 6.6.34.Final
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore: bump dependencies and fix tests

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: snyk-bot <snyk-bot@snyk.io>
2025-10-31 18:51:32 -03:00

150 lines
4.6 KiB
YAML

name: PR Tasknote-web
permissions:
contents: read
on:
pull_request:
paths:
- 'client/**'
concurrency:
group: tasknote-web-${{ github.event.number }}
cancel-in-progress: true
jobs:
tasknote-web-code-checks:
name: Tasknote-web Code Checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- uses: actions/setup-node@v6
name: Set up Node
with:
node-version: '22'
- name: Clean and Install
run: cd client && npm ci
- name: Build
run: cd client && npm run build
- name: Lint
run: cd client && npm run lint
- name: Unit tests
run: cd client && npm run test:coverage
- name: SonarCloud Scan
uses: SonarSource/sonarqube-scan-action@v6.0.0
with:
projectBaseDir: client
args: >
-Dsonar.organization=ricardo-campos-org
-Dsonar.projectKey=ricardo-campos-org_react-typescript-todolist_client
-Dsonar.javascript.lcov.reportPaths=coverage/lcov.info
-Dsonar.typescript.tsconfigPaths=tsconfig.json
-Dsonar.sources=src/
-Dsonar.exclusions=src/__test__/**
-Dsonar.tests=src/__test__/
-Dsonar.verbose=false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
tasknote-web-docker-build:
name: Build Tasknote-web Docker image
permissions:
contents: read
packages: write
runs-on: ubuntu-latest
needs: tasknote-web-code-checks
env:
VITE_BUILD: tasknote-web:${{ github.event.number }}
VITE_BACKEND_SERVER: ${{ secrets.SERVER_ADDRESS }}/server
steps:
- uses: actions/checkout@v5
- uses: docker/setup-buildx-action@v3
name: Set up Docker Buildx
- uses: docker/login-action@v3
name: Login to GitHub Container Registry
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get current date
id: date
run: echo "date=$(date +'%Y-%m-%d-%H%M%S')" >> $GITHUB_OUTPUT
- name: Build and push
uses: docker/build-push-action@v6
with:
push: true
context: ./client
tags: ghcr.io/ricardo-campos-org/react-typescript-todolist/tasknote-web:candidate
build-args: |
VITE_BUILD=v${{ github.event.number }}-${{ steps.date.outputs.date }}
SOURCE_PR=v${{ github.event.number }}-${{ github.run_id }}-${{ steps.date.outputs.date }}
cache-from: type=gha
cache-to: type=gha,mode=max
tasknote-web-stage-deployments:
name: Deploy Changes to Stage
runs-on: ubuntu-latest
needs: tasknote-web-docker-build
if: github.event.pull_request.user.login == 'rmcampos' && github.event_name == 'pull_request'
env:
DEPLOY_DOMAIN: ${{ vars.DEPLOY_DOMAIN }}
API_KEY: ${{ secrets.DOKPLOY_API_KEY }}
CLIENT_APPID: ${{ secrets.STAGE_WEB_CLIENT_ID }}
steps:
- name: Checking cURL version
run: curl --version
- name: Pre-deployment check
run: |
if ! curl -s -f "${{ vars.CLIENT_STAGE_URL }}" > /dev/null; then
echo "Stage environment is not healthy"
else
echo "Stage environment is healthy"
fi
- name: Trigger Deployment
uses: nick-fields/retry@v3.0.2
with:
timeout_minutes: 2
max_attempts: 3
command: |
response=$(curl -X POST \
"${DEPLOY_DOMAIN}/api/application.deploy" \
--max-time 30 \
-H "accept: application/json" \
-H "x-api-key: ${API_KEY}" \
-H "Content-Type: application/json" \
-d "{\"applicationId\":\"${CLIENT_APPID}\"}" \
-w "\n%{http_code}" \
-s)
status_code=$(echo "$response" | tail -n1)
echo "Status code: $status_code"
if [ "$status_code" != "200" ]; then
body=$(echo "$response" | sed '$d')
echo "Deployment failed with status code $status_code"
echo -e "Response body: $body"
exit 1
else
echo "Deployment succeeded!"
fi
- name: Verifying post deployment
run: |
# Wait for deployment to complete
sleep 15
if ! curl -s -f "${{ vars.CLIENT_STAGE_URL }}" > /dev/null; then
echo "Stage environment is not healthy"
exit 1
else
echo "Stage environment is healthy"
fi