|
| 1 | +name: CI ARM64 Build and Push |
| 2 | + |
| 3 | +on: |
| 4 | + # push: |
| 5 | + # branches: |
| 6 | + # - "master" |
| 7 | + # tags-ignore: |
| 8 | + # - "*" |
| 9 | + # pull_request: |
| 10 | + # branches-ignore: |
| 11 | + # - "*" |
| 12 | + workflow_dispatch: |
| 13 | + |
| 14 | +jobs: |
| 15 | + build-and-push-arm64: |
| 16 | + if: github.event_name == 'workflow_dispatch' |
| 17 | + runs-on: ubuntu-latest |
| 18 | + strategy: |
| 19 | + matrix: |
| 20 | + os: [ubuntu-22.04] |
| 21 | + python: ["3.11"] |
| 22 | + env: |
| 23 | + # secrets can be set in settings/secrets on github |
| 24 | + DOCKER_REGISTRY: ${{ secrets.DOCKER_REGISTRY }} |
| 25 | + steps: |
| 26 | + - uses: actions/checkout@v4 |
| 27 | + - name: setup QEMU |
| 28 | + uses: docker/setup-qemu-action@v3 |
| 29 | + - name: setup docker buildx |
| 30 | + id: buildx |
| 31 | + uses: docker/setup-buildx-action@v3 |
| 32 | + with: |
| 33 | + driver: docker-container |
| 34 | + - name: expose github runtime for buildx |
| 35 | + uses: crazy-max/ghaction-github-runtime@v3 |
| 36 | + - name: show system environs |
| 37 | + run: ./ci/helpers/show_system_versions.bash |
| 38 | + - name: login to Dockerhub |
| 39 | + uses: docker/login-action@v2 |
| 40 | + with: |
| 41 | + username: ${{ secrets.DOCKER_USERNAME }} |
| 42 | + password: ${{ secrets.DOCKER_PASSWORD }} |
| 43 | + - name: Set deployment variables |
| 44 | + run: | |
| 45 | + if [ "${GITHUB_REF}" == "refs/heads/master" ]; then |
| 46 | + echo "TAG_PREFIX=master-github" >> $GITHUB_ENV |
| 47 | + elif [[ "${GITHUB_REF}" == refs/heads/hotfix_v* ]]; then |
| 48 | + echo "TAG_PREFIX=hotfix-github" >> $GITHUB_ENV |
| 49 | + elif [[ "${GITHUB_REF}" == refs/heads/hotfix_staging_* ]]; then |
| 50 | + echo "TAG_PREFIX=hotfix-staging-github" >> $GITHUB_ENV |
| 51 | + fi |
| 52 | + - name: build & push images for latest tag |
| 53 | + run: | |
| 54 | + export DOCKER_IMAGE_TAG="$TAG_PREFIX-latest-arm64" |
| 55 | + export DOCKER_TARGET_PLATFORMS=linux/arm64 |
| 56 | + make build push=true |
| 57 | + - name: build & push images for specific tag |
| 58 | + run: | |
| 59 | + export DOCKER_IMAGE_TAG=$(exec ci/helpers/build_docker_image_tag.bash)-arm64 |
| 60 | + export DOCKER_TARGET_PLATFORMS=linux/arm64 |
| 61 | + make build push=true |
| 62 | + - name: fuse images in the registry for latest tag |
| 63 | + run: | |
| 64 | + export DOCKER_IMAGE_TAG="$TAG_PREFIX-latest" |
| 65 | + make docker-image-fuse SUFFIX=arm64 |
| 66 | + - name: set git tag |
| 67 | + run: echo "GIT_TAG=${GITHUB_REF##*/}" >> $GITHUB_ENV |
0 commit comments