This file contains 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_img_ubuntu24" | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- ".github/workflows/docker_build/build-ubuntu-24.yml" | |
- "docker/Dockerfile.build_ubuntu24" | |
- "autogen.sh*" | |
- "script/openssl_update.sh" | |
env: | |
# Use docker.io for Docker Hub if empty | |
REGISTRY: docker.io | |
# github.repository as <account>/<repo> | |
IMAGE_NAME: laoshanxi/appmesh | |
permissions: # added using https://github.com/step-security/secure-workflows | |
contents: read | |
jobs: | |
build-and-push-images: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
# This is used to complete the identity challenge | |
# with sigstore/fulcio when running outside of PRs. | |
id-token: write | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@v2 | |
with: | |
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs | |
- name: Checkout Github code | |
uses: actions/checkout@v4 | |
# https://docs.docker.com/build/ci/github-actions/multi-platform/ | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
# Workaround: https://github.com/docker/build-push-action/issues/461 | |
- name: Setup Docker buildx | |
uses: docker/setup-buildx-action@v3 | |
# https://github.com/docker/login-action | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
# Build and push Docker image with Buildx (don't push on PR) | |
# https://github.com/docker/build-push-action | |
- name: Build and push Docker image for ubuntu 24 | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
file: docker/Dockerfile.build_ubuntu24 | |
no-cache: true | |
platforms: linux/amd64,linux/arm64 | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: | | |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:build_ubuntu24 |