-
Notifications
You must be signed in to change notification settings - Fork 20
67 lines (57 loc) · 2 KB
/
build-ubuntu-24.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
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