* 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.4 to 3.5.5. - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.5.4...v3.5.5) --- updated-dependencies: - dependency-name: org.springframework.boot:spring-boot-starter-parent dependency-version: 3.5.5 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): bump io.jsonwebtoken:jjwt-jackson in /server Bumps io.jsonwebtoken:jjwt-jackson from 0.12.7 to 0.13.0. --- updated-dependencies: - dependency-name: io.jsonwebtoken:jjwt-jackson dependency-version: 0.13.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): bump io.jsonwebtoken:jjwt-impl in /server Bumps [io.jsonwebtoken:jjwt-impl](https://github.com/jwtk/jjwt) from 0.12.7 to 0.13.0. - [Release notes](https://github.com/jwtk/jjwt/releases) - [Changelog](https://github.com/jwtk/jjwt/blob/master/CHANGELOG.md) - [Commits](https://github.com/jwtk/jjwt/compare/0.12.7...0.13.0) --- updated-dependencies: - dependency-name: io.jsonwebtoken:jjwt-impl dependency-version: 0.13.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): bump io.jsonwebtoken:jjwt-api in /server Bumps [io.jsonwebtoken:jjwt-api](https://github.com/jwtk/jjwt) from 0.12.7 to 0.13.0. - [Release notes](https://github.com/jwtk/jjwt/releases) - [Changelog](https://github.com/jwtk/jjwt/blob/master/CHANGELOG.md) - [Commits](https://github.com/jwtk/jjwt/compare/0.12.7...0.13.0) --- updated-dependencies: - dependency-name: io.jsonwebtoken:jjwt-api dependency-version: 0.13.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * feat: add Taskfile * feat: add files, tasks and more automations * feat: disable email sending if not configured * chore: rename client to tasknote-web * feat: add devtools for faster development * feat: Re-tag Docker image with 'latest' tag * feat: update wording and improve taskfile * Implement ApplicationRunner for startup logging * fix: add reachability json file * feat: drop old config for JJWT * Revert "feat: drop old config for JJWT" This reverts commit ed29cf4684454b0d5e3f1a284b479e2bb6872ad7. * chore: JJWT finally working now * test: fix test cases * ci: fix permissions * test: add more test cases --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
150 lines
4.6 KiB
YAML
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@v4
|
|
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@v5.3.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
|