diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 6e0e8ad..54b3d2f 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -2,7 +2,7 @@ name: Build & Deploy on: push: - branches: [production] + branches: [dev, production] env: FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true @@ -17,6 +17,21 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Set deployment environment + run: | + if [ "${GITHUB_REF_NAME}" = "production" ]; then + echo "DEPLOY_ENV=production" >> "$GITHUB_ENV" + echo "IMAGE_TAG=latest" >> "$GITHUB_ENV" + echo "DEPLOY_PATH=/srv/services/services/reportx/production" >> "$GITHUB_ENV" + elif [ "${GITHUB_REF_NAME}" = "dev" ]; then + echo "DEPLOY_ENV=dev" >> "$GITHUB_ENV" + echo "IMAGE_TAG=dev" >> "$GITHUB_ENV" + echo "DEPLOY_PATH=/srv/services/services/reportx/dev" >> "$GITHUB_ENV" + else + echo "Unsupported branch: ${GITHUB_REF_NAME}" + exit 1 + fi + - name: Log in to GHCR uses: docker/login-action@v3 with: @@ -29,7 +44,7 @@ jobs: with: context: . push: true - tags: ghcr.io/aimagelab-zip/reportx:latest + tags: ghcr.io/aimagelab-zip/reportx:${{ env.IMAGE_TAG }} - name: Deploy to server uses: appleboy/ssh-action@v1 @@ -37,12 +52,13 @@ jobs: host: ${{ secrets.SSH_HOST }} username: ${{ secrets.SSH_USER }} key: ${{ secrets.SSH_KEY }} - envs: GHCR_TOKEN,GHCR_USER + envs: GHCR_TOKEN,GHCR_USER,DEPLOY_PATH script: | echo "$GHCR_TOKEN" | docker login ghcr.io -u "$GHCR_USER" --password-stdin - cd /srv/services/services/reportx/production + cd "$DEPLOY_PATH" docker compose pull docker compose up -d env: GHCR_TOKEN: ${{ secrets.GITHUB_TOKEN }} GHCR_USER: ${{ github.actor }} + DEPLOY_PATH: ${{ env.DEPLOY_PATH }} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..c418f04 --- /dev/null +++ b/README.md @@ -0,0 +1,53 @@ +# ReportX + +Documentation site for the ReportX annotation protocol, served as a static nginx container. + +## Site contents + +The site covers the ReportX annotation protocol across four pages: + +- **index.html** — main protocol reference: tumor region legend and field definitions for the annotation template +- **clinicians.html** — annotators guide (available in both English and Italian) +- **dataset-release.html** — dataset release template with field definitions and tumor region legend +- **join.html** — recruitment page for new annotators + +## Repository structure + +``` +├── .github/workflows/ +│ └── deploy.yml # CI/CD pipeline (build → push → deploy) +├── Dockerfile +├── docker-compose.yml +├── *.html / *.css / *.js +└── assets/ +``` + +## Branching flow + +`dev-` → `dev` → `production` + +Work on your branch, then open a PR to `dev` for integration/staging. Once validated, `dev` is promoted to `production`. + +## Environments + +| Environment | URL | Availability | +|---|---|---| +| Dev | `http://services-host.ing.unimore.it:8096` | Unimore network only | +| Production | `https://reportx.unimore.it` | Public | + +## Deploying + +**Do not run `docker compose` manually.** Deploys are fully automated via GitHub Actions. + +- Push/merge to `dev` → builds and pushes `ghcr.io/aimagelab-zip/reportx:dev`, then restarts the dev container. +- Push/merge to `production` → builds and pushes `ghcr.io/aimagelab-zip/reportx:latest`, then restarts the production container. + +### Required GitHub secrets + +| Secret | Description | +|---|---| +| `SSH_HOST` | Server hostname or IP | +| `SSH_USER` | SSH username on the server | +| `SSH_KEY` | Private SSH key for that user | + +`GITHUB_TOKEN` is provided automatically by Actions and is used for GHCR authentication. diff --git a/clinicians.html b/clinicians.html index 46ec39e..164a761 100644 --- a/clinicians.html +++ b/clinicians.html @@ -3,10 +3,10 @@ - BraTS Reports Annotators Guide + ReportX Annotators Guide @@ -14,7 +14,7 @@