diff --git a/.gitea/workflows/ci-engine.yml b/.gitea/workflows/ci-engine.yml index 79f2565..ba66fb6 100644 --- a/.gitea/workflows/ci-engine.yml +++ b/.gitea/workflows/ci-engine.yml @@ -15,6 +15,9 @@ jobs: publish: runs-on: ubuntu-latest env: + GITEA_API_URL: https://gitea.app.keskikuja.site + PAGES_HOST: ci-reports.helm-dev.keskikuja.site + GIT_PAGES_PUBLISH_URL: https://ci-reports.helm-dev.keskikuja.site GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} GIT_PAGES_PUBLISH_TOKEN: ${{ secrets.GIT_PAGES_PUBLISH_TOKEN }} steps: @@ -22,8 +25,3 @@ jobs: - name: Publish reports run: bash scripts/publish.sh reports - - - name: Set commit status - run: | - REPORT_URL="https://${PAGES_HOST}/${GITHUB_REPOSITORY}/reports/${GITHUB_SHA:0:8}/" - bash scripts/report-status.sh success "Reports published" "$REPORT_URL" ci-publish diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 4fa0df1..fd68679 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -5,6 +5,12 @@ on: workflow_dispatch: jobs: - call-engine: + feature: + if: github.ref != 'refs/heads/main' + uses: niko/gitea-ci-library/.gitea/workflows/ci-engine.yml@plan/0003-alkaa-käyttämään-itseään-commit-raportti + secrets: inherit + + main: + if: github.ref == 'refs/heads/main' uses: niko/gitea-ci-library/.gitea/workflows/ci-engine.yml@plan/0003-alkaa-käyttämään-itseään-commit-raportti secrets: inherit diff --git a/.gitignore b/.gitignore index 71dd431..7de0cc5 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ AGENTS.md .ai node_modules/ +tmp/ diff --git a/scripts/publish.sh b/scripts/publish.sh new file mode 100644 index 0000000..299f3ce --- /dev/null +++ b/scripts/publish.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +# Vie raportit git-pagesiin + commit-status linkillä +set -euo pipefail + +REPORT_DIR="${1:-reports}" +PAGES_HOST="${PAGES_HOST:-ci-reports.helm-dev.keskikuja.site}" + +REPORT_URL=$(bash "$(dirname $0)/publish-git-pages.sh" "$REPORT_DIR") +echo "Published: $REPORT_URL" +bash "$(dirname $0)/report-status.sh" success "Reports published" "$REPORT_URL" ci-report