|
| 1 | +name: Nightly Images |
| 2 | + |
| 3 | +on: |
| 4 | + schedule: |
| 5 | + - cron: "17 4 * * *" |
| 6 | + workflow_dispatch: |
| 7 | + |
| 8 | +env: |
| 9 | + REGISTRY: ghcr.io |
| 10 | + IMAGE_NAME: thevibeworks/deva |
| 11 | + |
| 12 | +permissions: |
| 13 | + contents: read |
| 14 | + packages: write |
| 15 | + |
| 16 | +concurrency: |
| 17 | + group: nightly-images |
| 18 | + cancel-in-progress: true |
| 19 | + |
| 20 | +jobs: |
| 21 | + resolve-versions: |
| 22 | + name: Resolve Latest Tool Versions |
| 23 | + runs-on: ubuntu-latest |
| 24 | + outputs: |
| 25 | + stamp: ${{ steps.versions.outputs.stamp }} |
| 26 | + claude_code_version: ${{ steps.versions.outputs.claude_code_version }} |
| 27 | + codex_version: ${{ steps.versions.outputs.codex_version }} |
| 28 | + gemini_cli_version: ${{ steps.versions.outputs.gemini_cli_version }} |
| 29 | + atlas_cli_version: ${{ steps.versions.outputs.atlas_cli_version }} |
| 30 | + copilot_api_version: ${{ steps.versions.outputs.copilot_api_version }} |
| 31 | + steps: |
| 32 | + - name: Checkout |
| 33 | + uses: actions/checkout@v4 |
| 34 | + |
| 35 | + - name: Setup Node |
| 36 | + uses: actions/setup-node@v4 |
| 37 | + with: |
| 38 | + node-version: "22" |
| 39 | + |
| 40 | + - name: Resolve versions |
| 41 | + id: versions |
| 42 | + shell: bash |
| 43 | + env: |
| 44 | + GH_TOKEN: ${{ github.token }} |
| 45 | + run: bash ./scripts/resolve-tool-versions.sh |
| 46 | + |
| 47 | + - name: Summary |
| 48 | + run: | |
| 49 | + cat <<EOF >> "$GITHUB_STEP_SUMMARY" |
| 50 | + ## Nightly Tool Versions |
| 51 | +
|
| 52 | + - Claude Code: \`${{ steps.versions.outputs.claude_code_version }}\` |
| 53 | + - Codex: \`${{ steps.versions.outputs.codex_version }}\` |
| 54 | + - Gemini CLI: \`${{ steps.versions.outputs.gemini_cli_version }}\` |
| 55 | + - Atlas CLI: \`${{ steps.versions.outputs.atlas_cli_version }}\` |
| 56 | + - Copilot API: \`${{ steps.versions.outputs.copilot_api_version }}\` |
| 57 | + - Stamp: \`${{ steps.versions.outputs.stamp }}\` |
| 58 | + EOF |
| 59 | +
|
| 60 | + build-base: |
| 61 | + name: Build Nightly Base Image |
| 62 | + needs: resolve-versions |
| 63 | + runs-on: ubuntu-latest |
| 64 | + steps: |
| 65 | + - name: Checkout |
| 66 | + uses: actions/checkout@v4 |
| 67 | + |
| 68 | + - name: Set up QEMU |
| 69 | + uses: docker/setup-qemu-action@v3 |
| 70 | + |
| 71 | + - name: Set up Docker Buildx |
| 72 | + uses: docker/setup-buildx-action@v3 |
| 73 | + |
| 74 | + - name: Log in to Container Registry |
| 75 | + uses: docker/login-action@v3 |
| 76 | + with: |
| 77 | + registry: ${{ env.REGISTRY }} |
| 78 | + username: ${{ github.actor }} |
| 79 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 80 | + |
| 81 | + - name: Extract metadata |
| 82 | + id: meta |
| 83 | + uses: docker/metadata-action@v5 |
| 84 | + with: |
| 85 | + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} |
| 86 | + tags: | |
| 87 | + type=raw,value=nightly |
| 88 | + type=raw,value=nightly-${{ needs.resolve-versions.outputs.stamp }} |
| 89 | + labels: | |
| 90 | + org.opencontainers.image.title=deva-nightly |
| 91 | + org.opencontainers.image.description=Nightly deva image with latest upstream CLI versions |
| 92 | +
|
| 93 | + - name: Build and push base image |
| 94 | + uses: docker/build-push-action@v5 |
| 95 | + with: |
| 96 | + context: . |
| 97 | + file: ./Dockerfile |
| 98 | + platforms: linux/amd64,linux/arm64 |
| 99 | + push: true |
| 100 | + tags: ${{ steps.meta.outputs.tags }} |
| 101 | + labels: ${{ steps.meta.outputs.labels }} |
| 102 | + cache-from: type=gha,scope=nightly-base |
| 103 | + cache-to: type=gha,mode=max,scope=nightly-base |
| 104 | + build-args: | |
| 105 | + CLAUDE_CODE_VERSION=${{ needs.resolve-versions.outputs.claude_code_version }} |
| 106 | + CODEX_VERSION=${{ needs.resolve-versions.outputs.codex_version }} |
| 107 | + GEMINI_CLI_VERSION=${{ needs.resolve-versions.outputs.gemini_cli_version }} |
| 108 | + ATLAS_CLI_VERSION=${{ needs.resolve-versions.outputs.atlas_cli_version }} |
| 109 | + COPILOT_API_VERSION=${{ needs.resolve-versions.outputs.copilot_api_version }} |
| 110 | +
|
| 111 | + build-rust: |
| 112 | + name: Build Nightly Rust Image |
| 113 | + needs: [resolve-versions, build-base] |
| 114 | + runs-on: ubuntu-latest |
| 115 | + steps: |
| 116 | + - name: Checkout |
| 117 | + uses: actions/checkout@v4 |
| 118 | + |
| 119 | + - name: Set up QEMU |
| 120 | + uses: docker/setup-qemu-action@v3 |
| 121 | + |
| 122 | + - name: Set up Docker Buildx |
| 123 | + uses: docker/setup-buildx-action@v3 |
| 124 | + |
| 125 | + - name: Log in to Container Registry |
| 126 | + uses: docker/login-action@v3 |
| 127 | + with: |
| 128 | + registry: ${{ env.REGISTRY }} |
| 129 | + username: ${{ github.actor }} |
| 130 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 131 | + |
| 132 | + - name: Extract metadata |
| 133 | + id: meta |
| 134 | + uses: docker/metadata-action@v5 |
| 135 | + with: |
| 136 | + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} |
| 137 | + tags: | |
| 138 | + type=raw,value=nightly-rust |
| 139 | + type=raw,value=nightly-${{ needs.resolve-versions.outputs.stamp }}-rust |
| 140 | + labels: | |
| 141 | + org.opencontainers.image.title=deva-nightly-rust |
| 142 | + org.opencontainers.image.description=Nightly deva rust image with latest upstream CLI versions |
| 143 | +
|
| 144 | + - name: Build and push rust image |
| 145 | + uses: docker/build-push-action@v5 |
| 146 | + with: |
| 147 | + context: . |
| 148 | + file: ./Dockerfile.rust |
| 149 | + platforms: linux/amd64,linux/arm64 |
| 150 | + push: true |
| 151 | + tags: ${{ steps.meta.outputs.tags }} |
| 152 | + labels: ${{ steps.meta.outputs.labels }} |
| 153 | + cache-from: type=gha,scope=nightly-rust |
| 154 | + cache-to: type=gha,mode=max,scope=nightly-rust |
| 155 | + build-args: | |
| 156 | + BASE_IMAGE=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:nightly-${{ needs.resolve-versions.outputs.stamp }} |
| 157 | +
|
| 158 | + summary: |
| 159 | + name: Nightly Summary |
| 160 | + needs: [resolve-versions, build-base, build-rust] |
| 161 | + runs-on: ubuntu-latest |
| 162 | + steps: |
| 163 | + - name: Publish summary |
| 164 | + run: | |
| 165 | + cat <<EOF >> "$GITHUB_STEP_SUMMARY" |
| 166 | + ## Published Nightly Images |
| 167 | +
|
| 168 | + - \`ghcr.io/thevibeworks/deva:nightly\` |
| 169 | + - \`ghcr.io/thevibeworks/deva:nightly-${{ needs.resolve-versions.outputs.stamp }}\` |
| 170 | + - \`ghcr.io/thevibeworks/deva:nightly-rust\` |
| 171 | + - \`ghcr.io/thevibeworks/deva:nightly-${{ needs.resolve-versions.outputs.stamp }}-rust\` |
| 172 | +
|
| 173 | + This workflow refreshes nightly image tags only. |
| 174 | + Semver releases and GitHub Releases remain manual. |
| 175 | + EOF |
0 commit comments