name: Release on: push: tags: - "v*" permissions: contents: write jobs: release: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: "24" cache: "npm" - name: Install dependencies run: npm ci - name: Update package.json version run: | TAG_VERSION="${{ github.ref_name }}" VERSION="${TAG_VERSION#v}" npm version "$VERSION" --no-git-tag-version - name: Run type checking run: npm run check - name: Run linting run: npm run lint - name: Run unit tests run: npm run test:unit -- --run env: DATABASE_URL: "postgresql://test:test@localhost:5432/test" SMTP_HOST: "smtp.example.com" SMTP_PORT: "587" SMTP_SECURE: "false" SMTP_USER: "your-email@example.com" SMTP_PASS: "your-password" SMTP_FROM_NAME: "Open Reception" SMTP_FROM_EMAIL: "noreply@example.com" JWT_SECRET: "test" - name: Build application run: npm run build env: DATABASE_URL: "postgresql://test:test@localhost:5432/test" JWT_SECRET: "build" - name: Log in to Docker Hub uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - name: Build Docker image run: docker build -t openreception/open-reception:${{ github.ref_name }} . - name: Run Trivy vulnerability scanner uses: aquasecurity/trivy-action@master with: image-ref: "openreception/open-reception:${{ github.ref_name }}" format: "table" exit-code: "1" ignore-unfixed: true vuln-type: "os,library" severity: "CRITICAL,HIGH" - name: Push Docker images run: npm run docker:build-and-push - name: Create Release Archive run: | mkdir -p release-assets tar -czf release-assets/open-reception-${{ github.ref_name }}.tar.gz build/ - name: Create GitHub Release uses: softprops/action-gh-release@v2 with: name: Release ${{ github.ref_name }} generate_release_notes: true body: | ## Release ${{ github.ref_name }} This release includes the latest version of Open Reception appointment booking software. ### What's Changed ### Installation Extract the archive and follow the deployment instructions in the README. **Full Changelog**: https://github.com/${{ github.repository }}/compare/${{ github.event.before }}...${{ github.ref_name }} files: | release-assets/open-reception-${{ github.ref_name }}.tar.gz draft: false prerelease: ${{ contains(github.ref_name, '-') }}