diff --git a/.ddev/.env.template b/.ddev/.env.template index e79deeed8..b0085cad6 100644 --- a/.ddev/.env.template +++ b/.ddev/.env.template @@ -1,5 +1,5 @@ # ZMS Core -ZMS_API_URL=https://localhost/terminvereinbarung/api/2 +ZMS_API_URL=https://zms.ddev.site/terminvereinbarung/api/2 ZMS_CRONROOT=1 ZMS_ENV=dev #ZMS_TIMEADJUST='2016-04-01 H:i' diff --git a/.github/workflows/static.yaml b/.github/workflows/build-api-docs.yaml similarity index 71% rename from .github/workflows/static.yaml rename to .github/workflows/build-api-docs.yaml index 4fb48fe6b..73d9fa8ac 100644 --- a/.github/workflows/static.yaml +++ b/.github/workflows/build-api-docs.yaml @@ -1,27 +1,20 @@ -# Workflow for deploying API documentation to Pages -name: Deploy API Documentation to Pages +name: Build API Documentation on: - push: - branches: ["main"] - workflow_dispatch: + workflow_call: + outputs: + result: + description: "Build result" + value: ${{ jobs.build.outputs.result }} permissions: contents: read - pages: write - id-token: write - -concurrency: - group: "pages" - cancel-in-progress: false jobs: - deploy: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} + build: runs-on: ubuntu-latest - + outputs: + result: ${{ steps.set-result.outputs.result }} steps: - name: Checkout uses: actions/checkout@v4 @@ -70,14 +63,15 @@ jobs: npx swagger-cli bundle -o public/doc/swagger.json public/doc/swagger.yaml cd .. - - name: Setup Pages - uses: actions/configure-pages@v5 - - - name: Upload artifact - uses: actions/upload-pages-artifact@v3 + - name: Upload API docs artifact + uses: actions/upload-artifact@v4 with: - path: '.' + name: api-docs + path: | + zmsapi/public/doc/ + zmscitizenapi/public/doc/ - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 + - name: Set job result + id: set-result + if: always() + run: echo "result=${{ job.status }}" >> $GITHUB_OUTPUT \ No newline at end of file diff --git a/.github/workflows/combined-workflow-with-docs.yaml b/.github/workflows/combined-workflow-with-docs.yaml new file mode 100644 index 000000000..ce497a462 --- /dev/null +++ b/.github/workflows/combined-workflow-with-docs.yaml @@ -0,0 +1,55 @@ +name: Combined Workflow with Documentation + +on: + push: + branches: [next] + +permissions: + contents: read + packages: write + pages: write + id-token: write + +jobs: + call-php-code-quality: + uses: ./.github/workflows/php-code-quality.yaml + + call-php-unit-tests: + uses: ./.github/workflows/php-unit-tests.yaml + + combine-php-test-coverage: + needs: [call-php-unit-tests] + runs-on: ubuntu-latest + steps: + - name: Download all coverage reports + uses: actions/download-artifact@v4 + with: + pattern: 'coverage-*' + path: public/coverage + merge-multiple: false + + - name: Upload coverage artifact + uses: actions/upload-artifact@v4 + with: + name: coverage-reports + path: public/coverage/ + retention-days: 7 + + call-build-api-docs: + uses: ./.github/workflows/build-api-docs.yaml + + deploy-to-pages: + needs: [combine-php-test-coverage, call-build-api-docs] + if: needs.call-build-api-docs.result == 'success' + uses: ./.github/workflows/deploy-pages.yaml + with: + coverage_artifact: coverage-reports + api_docs_artifact: api-docs + + call-php-build-images: + needs: [call-php-code-quality, call-php-unit-tests] + if: | + always() && + needs.call-php-code-quality.result == 'success' && + needs.call-php-unit-tests.result == 'success' + uses: ./.github/workflows/php-build-images.yaml \ No newline at end of file diff --git a/.github/workflows/combined-workflow.yaml b/.github/workflows/combined-workflow.yaml index 8524121c4..13e248c9f 100644 --- a/.github/workflows/combined-workflow.yaml +++ b/.github/workflows/combined-workflow.yaml @@ -1,11 +1,25 @@ name: Combined Workflow -on: [push] +on: + push: + branches-ignore: [next] + workflow_call: + +permissions: + contents: read + packages: write jobs: - call-unit-tests: - uses: ./.github/workflows/unit-tests.yaml + call-php-code-quality: + uses: ./.github/workflows/php-code-quality.yaml + + call-php-unit-tests: + uses: ./.github/workflows/php-unit-tests.yaml - call-build-images: - needs: call-unit-tests - uses: ./.github/workflows/build-images.yaml + call-php-build-images: + needs: [call-php-code-quality, call-php-unit-tests] + if: | + always() && + needs.call-php-code-quality.result == 'success' && + needs.call-php-unit-tests.result == 'success' + uses: ./.github/workflows/php-build-images.yaml \ No newline at end of file diff --git a/.github/workflows/deploy-pages.yaml b/.github/workflows/deploy-pages.yaml new file mode 100644 index 000000000..3144b1292 --- /dev/null +++ b/.github/workflows/deploy-pages.yaml @@ -0,0 +1,147 @@ +name: Deploy to GitHub Pages + +on: + workflow_call: + inputs: + coverage_artifact: + description: 'Name of the coverage reports artifact' + required: true + type: string + default: 'coverage-reports' + api_docs_artifact: + description: 'Name of the API documentation artifact' + required: true + type: string + default: 'api-docs' + +permissions: + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + deploy: + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Create public directory + run: mkdir -p public + + - name: Download coverage reports + uses: actions/download-artifact@v4 + with: + name: ${{ inputs.coverage_artifact }} + path: public/coverage + + - name: Download API docs + uses: actions/download-artifact@v4 + with: + name: ${{ inputs.api_docs_artifact }} + path: public + + - name: Create index page + run: | + cat > public/index.html <<'EOL' + + +
+