testing arch issue #45
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 and Push with Git Tag | |
| on: | |
| push: | |
| tags: | |
| - "*" | |
| env: | |
| REGISTRY: gcr.io/stackgen-gcp-marketplace | |
| IMAGE_NAME: stackgen-deployer/deployer | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| - name: Authenticate to Google Cloud | |
| uses: google-github-actions/auth@v2 | |
| with: | |
| credentials_json: '${{ secrets.GCP_SA_KEY }}' | |
| - name: Setup gcloud | |
| uses: google-github-actions/setup-gcloud@v2 | |
| - name: Configure Docker | |
| run: gcloud auth configure-docker gcr.io,marketplace.gcr.io | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Extract metadata (tags, labels) for Docker | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
| tags: | | |
| type=semver,pattern={{version}} | |
| type=semver,pattern={{major}}.{{minor}} | |
| - name: Docker Build and Push (Single Arch) | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: "deployer-image" | |
| platforms: 'linux/amd64' # 👈 Build only for AMD64 (change to 'linux/arm64' if needed) | |
| tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest-temp | |
| push: true | |
| provenance: false | |
| labels: ${{ steps.meta.outputs.labels }} | |
| - name: Create OCI Index Manifest (Wrap Single Arch) | |
| run: | | |
| # Create an OCI index with a single image and attach the required annotation | |
| docker buildx imagetools create \ | |
| --tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest \ | |
| --annotation index:com.googleapis.cloudmarketplace.product.service.name="services/stackgen-enterprise-platform-k8s-v2.endpoints.stackgen-gcp-marketplace.cloud.goog" \ | |
| ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest-temp | |
| - name: Remove Temporary Image | |
| run: | | |
| docker buildx imagetools rm ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest-temp |