|
39 | 39 | timeout-minutes: 15 |
40 | 40 | env: |
41 | 41 | IMAGE_NAME: ipfs/kubo |
42 | | - LEGACY_IMAGE_NAME: ipfs/go-ipfs |
| 42 | + outputs: |
| 43 | + tags: ${{ steps.tags.outputs.value }} |
43 | 44 | steps: |
44 | 45 | - name: Check out the repo |
45 | 46 | uses: actions/checkout@v5 |
@@ -140,3 +141,52 @@ jobs: |
140 | 141 | cache-to: | |
141 | 142 | type=gha,mode=max |
142 | 143 | type=registry,ref=${{ env.IMAGE_NAME }}:buildcache,mode=max |
| 144 | +
|
| 145 | + # Build and push stub image to the legacy ipfs/go-ipfs name |
| 146 | + # This redirects users to use ipfs/kubo instead |
| 147 | + legacy-name: |
| 148 | + needs: docker-hub |
| 149 | + if: github.repository == 'ipfs/kubo' || github.event_name == 'workflow_dispatch' |
| 150 | + name: Push stub to legacy ipfs/go-ipfs name |
| 151 | + runs-on: ubuntu-latest |
| 152 | + timeout-minutes: 5 |
| 153 | + env: |
| 154 | + LEGACY_IMAGE_NAME: ipfs/go-ipfs |
| 155 | + steps: |
| 156 | + - name: Check out the repo |
| 157 | + uses: actions/checkout@v5 |
| 158 | + |
| 159 | + - name: Set up QEMU |
| 160 | + uses: docker/setup-qemu-action@v3 |
| 161 | + |
| 162 | + - name: Set up Docker Buildx |
| 163 | + uses: docker/setup-buildx-action@v3 |
| 164 | + |
| 165 | + - name: Log in to Docker Hub |
| 166 | + uses: docker/login-action@v3 |
| 167 | + with: |
| 168 | + username: ${{ vars.DOCKER_USERNAME }} |
| 169 | + password: ${{ secrets.DOCKER_PASSWORD }} |
| 170 | + |
| 171 | + - name: Convert tags to legacy image name |
| 172 | + id: legacy_tags |
| 173 | + run: | |
| 174 | + TAGS="${{ github.event.inputs.tags || needs.docker-hub.outputs.tags }}" |
| 175 | + if ! echo "$TAGS" | grep -q "kubo"; then |
| 176 | + echo "ERROR: Tags must contain kubo image name" |
| 177 | + exit 1 |
| 178 | + fi |
| 179 | + echo "value<<EOF" >> $GITHUB_OUTPUT |
| 180 | + echo "$TAGS" | sed "s|ipfs/kubo|$LEGACY_IMAGE_NAME|g" >> $GITHUB_OUTPUT |
| 181 | + echo "EOF" >> $GITHUB_OUTPUT |
| 182 | + shell: bash |
| 183 | + |
| 184 | + - if: github.event_name != 'workflow_dispatch' || github.event.inputs.push == 'true' |
| 185 | + name: Build and push legacy stub image |
| 186 | + uses: docker/build-push-action@v6 |
| 187 | + with: |
| 188 | + platforms: linux/amd64,linux/arm/v7,linux/arm64/v8 |
| 189 | + context: . |
| 190 | + push: true |
| 191 | + file: ./.github/legacy/Dockerfile.goipfs-stub |
| 192 | + tags: ${{ steps.legacy_tags.outputs.value }} |
0 commit comments