name: CI Workflow on: push permissions: contents: read jobs: doc-generator: if: ${{ startsWith(github.ref, 'refs/tags/v') }} needs: - test defaults: run: shell: bash container: image: luzifer/gh-arch-env env: CGO_ENABLED: 0 GOPATH: /go permissions: contents: read pages: write id-token: write runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: lfs: true show-progress: false submodules: true - name: Marking workdir safe run: git config --global --add safe.directory /__w/twitch-bot/twitch-bot - name: Generate documentation run: make render_docs DOCS_BASE_URL=https://luzifer.github.io/twitch-bot/ - name: Upload GitHub Pages artifact uses: actions/upload-pages-artifact@v1 with: path: .rendered-docs - name: Deploy artifact uses: actions/deploy-pages@v1 docker-publish: if: ${{ startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/master' }} needs: - test defaults: run: shell: bash permissions: packages: write runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: show-progress: false - name: Log into registry uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Docker Build & Publish run: bash ci/docker-publish.sh integration-crdb: if: ${{ github.ref == 'refs/heads/master' }} needs: - test defaults: run: shell: bash container: image: luzifer/gh-arch-env env: CGO_ENABLED: 0 GOPATH: /go runs-on: ubuntu-latest services: crdb: image: luzifer/crdb-gh-service options: --health-cmd "curl -sSf http://localhost:8080/health" --health-interval 10s --health-timeout 5s --health-retries 5 steps: - name: Install required packages run: | pacman -Syy --noconfirm \ cockroachdb-bin - uses: actions/checkout@v4 with: show-progress: false - name: Marking workdir safe run: git config --global --add safe.directory /__w/twitch-bot/twitch-bot - name: Set up CRDB service run: | cockroach sql --host crdb --insecure <release_changelog.md - name: Update stable branch run: | git branch -f stable ${GITHUB_SHA} git push -f origin stable - name: Release uses: ncipollo/release-action@v1 with: artifacts: .build/* bodyFile: release_changelog.md draft: false generateReleaseNotes: false test: if: ${{ github.ref != 'refs/heads/stable' }} defaults: run: shell: bash container: image: luzifer/gh-arch-env env: CGO_ENABLED: 0 GOPATH: /go runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: show-progress: false - name: Marking workdir safe run: | git config --global --add safe.directory /__w/twitch-bot/twitch-bot - name: Lint and test code run: make lint test frontend_lint - name: Build release (quick local for compile) run: make build_prod - name: Execute Trivy scan run: make trivy