88 pull_request :
99 branches : [main, cloud, devel]
1010
11+ env :
12+ GITHUB_REGISTRY : ghcr.io
13+ DEV_CONTAINER_DOCKER_IMAGE : bencher-dev-container
14+
1115# Cancel in-progress runs for the same branch
1216concurrency :
1317 group : ${{ github.workflow }}-${{ github.ref }}
@@ -96,11 +100,26 @@ jobs:
96100 build-docker : ${{ needs.changes.outputs.docker == 'true' || github.ref == 'refs/heads/devel' || github.ref == 'refs/heads/cloud' || startsWith(github.ref, 'refs/tags/') }}
97101 build-cli : ${{ needs.changes.outputs.cli == 'true' || startsWith(github.ref, 'refs/tags/') }}
98102
103+ deploy :
104+ name : Deploy
105+ needs : [lint, cli, test, build]
106+ if : ${{ github.ref == 'refs/heads/devel' || github.ref == 'refs/heads/cloud' || (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'deploy')) }}
107+ uses : ./.github/workflows/deploy.yml
108+ with :
109+ deploy-dev : ${{ github.ref == 'refs/heads/devel' || (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'deploy')) }}
110+ deploy-test : ${{ github.ref == 'refs/heads/devel' || github.ref == 'refs/heads/cloud' }}
111+ deploy-prod : ${{ github.ref == 'refs/heads/cloud' }}
112+ secrets :
113+ FLY_API_TOKEN : ${{ secrets.FLY_API_TOKEN }}
114+ SENTRY_AUTH_TOKEN : ${{ secrets.SENTRY_AUTH_TOKEN }}
115+ NETLIFY_AUTH_TOKEN : ${{ secrets.NETLIFY_AUTH_TOKEN }}
116+ NETLIFY_SITE_ID : ${{ secrets.NETLIFY_SITE_ID }}
117+
99118 # Summary job for required status checks
100119 ci-success :
101120 name : CI Success
102121 runs-on : ubuntu-22.04
103- needs : [lint, cli, test, build]
122+ needs : [lint, cli, test, build, deploy ]
104123 if : always()
105124 steps :
106125 - name : Check all jobs passed
@@ -109,6 +128,10 @@ jobs:
109128 echo "Lint failed"
110129 exit 1
111130 fi
131+ if [[ "${{ needs.cli.result }}" != "success" ]]; then
132+ echo "CLI failed"
133+ exit 1
134+ fi
112135 if [[ "${{ needs.test.result }}" != "success" && "${{ needs.test.result }}" != "skipped" ]]; then
113136 echo "Test failed"
114137 exit 1
@@ -117,12 +140,31 @@ jobs:
117140 echo "Build failed"
118141 exit 1
119142 fi
143+ if [[ "${{ needs.deploy.result }}" != "success" && "${{ needs.deploy.result }}" != "skipped" ]]; then
144+ echo "Deploy failed"
145+ exit 1
146+ fi
120147 echo "All required jobs passed!"
121148
122- # Trigger Deploy Devel for PRs with the deploy label
123- deploy_devel :
124- name : Deploy Devel
125- needs : [ci-success]
126- if : ${{ github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'deploy') }}
127- uses : ./.github/workflows/deploy-devel.yml
128- secrets : inherit
149+ build_dev_container :
150+ name : Build dev container
151+ if : ${{ github.ref == 'refs/heads/devel' }}
152+ runs-on : ubuntu-22.04
153+ steps :
154+ - uses : actions/checkout@v6
155+ - name : Set up QEMU
156+ uses : docker/setup-qemu-action@v3
157+ - name : Setup Docker buildx
158+ uses : docker/setup-buildx-action@v3
159+ - name : Log in to the Container registry
160+ uses : docker/login-action@v3
161+ with :
162+ registry : ${{ env.GITHUB_REGISTRY }}
163+ username : ${{ github.actor }}
164+ password : ${{ secrets.GITHUB_TOKEN }}
165+ - name : Pre-build dev container image
166+ uses : devcontainers/ci@v0.3
167+ with :
168+ imageName : ${{ env.GITHUB_REGISTRY }}/${{ github.repository_owner }}/${{ env.DEV_CONTAINER_DOCKER_IMAGE }}
169+ cacheFrom : ${{ env.GITHUB_REGISTRY }}/${{ github.repository_owner }}/${{ env.DEV_CONTAINER_DOCKER_IMAGE }}
170+ push : always
0 commit comments