-
Notifications
You must be signed in to change notification settings - Fork 158
55 lines (46 loc) · 1.36 KB
/
Copy pathci-image.yml
File metadata and controls
55 lines (46 loc) · 1.36 KB
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
name: CI toolchain image
on:
workflow_dispatch:
push:
branches: [pre-release, main]
paths:
- Dockerfile
- .github/workflows/ci-image.yml
permissions:
contents: read
packages: write
concurrency:
group: ci-toolchain-image
cancel-in-progress: false
env:
IMAGE_NAME: ghcr.io/${{ github.repository_owner }}/cortex-ci
jobs:
publish:
name: publish-toolchain
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v7
- name: Log in to GHCR
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Build and publish the toolchain image
id: image
uses: docker/build-push-action@v7
with:
context: .
file: Dockerfile
platforms: linux/amd64
push: true
tags: ${{ env.IMAGE_NAME }}:toolchain-${{ hashFiles('Dockerfile') }}
cache-from: type=gha,scope=cortex-ci-toolchain
cache-to: type=gha,mode=max,scope=cortex-ci-toolchain
- name: Write the image digest
env:
IMAGE_DIGEST: ${{ steps.image.outputs.digest }}
run: echo "Published ${IMAGE_NAME}@${IMAGE_DIGEST}" >> "$GITHUB_STEP_SUMMARY"