feat: add GoCD pipeline for auto-deploy on push to master #37
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| jobs: | |
| build: | |
| name: Build and smoke test | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to GHCR | |
| if: github.event_name == 'push' | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| # Load into the local Docker daemon for the smoke test. | |
| # On main pushes we also push to GHCR (see next step). | |
| load: true | |
| platforms: linux/amd64 | |
| tags: sentry-orbital:local | |
| cache-from: type=registry,ref=ghcr.io/getsentry/sentry-orbital:nightly | |
| cache-to: type=inline | |
| labels: | | |
| org.opencontainers.image.revision=${{ github.sha }} | |
| org.opencontainers.image.source=https://github.com/getsentry/sentry-orbital | |
| - name: Smoke test | |
| run: | | |
| docker run --rm -d \ | |
| --name orbital-smoke \ | |
| -p 7000:7000 \ | |
| sentry-orbital:local | |
| # Wait for the container to be ready | |
| for i in $(seq 1 10); do | |
| if curl -sf http://localhost:7000/healthz; then | |
| break | |
| fi | |
| echo "Waiting... ($i)" | |
| sleep 1 | |
| done | |
| # /healthz must return 200 with body "ok" | |
| HEALTH=$(curl -sf http://localhost:7000/healthz) | |
| [ "$HEALTH" = "ok" ] || (echo "healthz returned: $HEALTH" && exit 1) | |
| # / must return 200 and contain the globe canvas | |
| curl -sf http://localhost:7000/ | grep -q 'orbital' || (echo "index page missing expected content" && exit 1) | |
| docker stop orbital-smoke | |
| - name: Push to GHCR | |
| if: github.event_name == 'push' | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| push: true | |
| platforms: linux/amd64 | |
| tags: | | |
| ghcr.io/getsentry/sentry-orbital:nightly | |
| ghcr.io/getsentry/sentry-orbital:${{ github.sha }} | |
| cache-from: type=registry,ref=ghcr.io/getsentry/sentry-orbital:nightly | |
| cache-to: type=inline | |
| labels: | | |
| org.opencontainers.image.revision=${{ github.sha }} | |
| org.opencontainers.image.source=https://github.com/getsentry/sentry-orbital |