arm push #21
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: Docker Image Release | |
| on: | |
| push: | |
| branches: ["main"] | |
| env: | |
| BUILD_ARGS: | | |
| RAILPACK_VERSION=0.4.0 | |
| jobs: | |
| build-arm: | |
| runs-on: ubuntu-24.04-arm | |
| steps: | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build and push multi-arch Docker image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| build-args: ${{ env.BUILD_ARGS }} | |
| file: Dockerfile | |
| platforms: linux/arm64 | |
| push: false | |
| cache-from: type=gha,scope=${{ github.workflow }} | |
| cache-to: type=gha,scope=${{ github.workflow }},mode=max | |
| build-push: | |
| needs: build-arm | |
| env: | |
| GCP_PROJECT: defang-io | |
| GCP_REGION: us-central1 | |
| permissions: | |
| contents: read | |
| id-token: write | |
| runs-on: ubuntu-latest | |
| environment: release | |
| steps: | |
| - name: Set IMAGE_TAG | |
| run: echo "IMAGE_TAG=$(echo $GITHUB_SHA | cut -c 1-7)" >> $GITHUB_ENV | |
| - name: Configure AWS Credentials for CI | |
| uses: aws-actions/configure-aws-credentials@v4 | |
| with: | |
| aws-region: us-west-2 | |
| role-to-assume: arn:aws:iam::488659951590:role/ci-role-d4fe904 # ciRoleArn from defang-io/infrastructure stack | |
| - name: Configure AWS Credentials for Staging | |
| uses: aws-actions/configure-aws-credentials@v4 | |
| with: | |
| aws-region: us-east-1 | |
| role-to-assume: arn:aws:iam::426819183542:role/admin # adminUserRoleArn from defang-io/bootstrap stack | |
| role-duration-seconds: 1200 | |
| role-chaining: true | |
| - name: Login to Amazon ECR Public | |
| id: login-ecr-public | |
| uses: aws-actions/amazon-ecr-login@v2 | |
| with: | |
| registry-type: public | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Configure GCP Credentials for Shared Services | |
| uses: "google-github-actions/auth@v2" | |
| with: | |
| project_id: ${{ env.GCP_PROJECT}} | |
| workload_identity_provider: "projects/806289336876/locations/global/workloadIdentityPools/github-actions/providers/github-actions-provider" | |
| - name: Authenticate to GCR | |
| run: | | |
| gcloud auth --project=${GCP_PROJECT} configure-docker ${GCP_REGION}-docker.pkg.dev --quiet | |
| - name: Build and push multi-arch Docker image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| build-args: ${{ env.BUILD_ARGS }} | |
| file: Dockerfile | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| tags: | | |
| defangio/railpack-builder:${{ env.IMAGE_TAG }} | |
| public.ecr.aws/defang-io/codebuild-railpack:${{ env.IMAGE_TAG }} | |
| cache-from: type=gha,scope=${{ github.workflow }} | |
| cache-to: type=gha,scope=${{ github.workflow }},mode=max |