-
Notifications
You must be signed in to change notification settings - Fork 6
67 lines (59 loc) · 2.1 KB
/
build.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: Docker
on: [push]
env:
KERNEL_VERSION: 6.5.9-ctsi-1
jobs:
build:
runs-on: ubuntu-22.04
permissions:
packages: write
contents: read
strategy:
matrix:
config: ["", "-rv64ima-lp64"]
steps:
- name: Checkout Source Code
uses: actions/checkout@v3
- name: Download linux
run: make download
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v4
with:
images: |
ghcr.io/${{ github.repository_owner }}/toolchain
docker.io/${{ github.repository_owner }}/toolchain,enable=${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/tags/v') }}
tags: |
type=ref,event=branch,suffix=${{ matrix.config }}
type=semver,pattern={{version}},suffix=${{ matrix.config }}
- name: Login to Docker Hub
uses: docker/login-action@v2
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/tags/v')
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Depot CLI
uses: depot/setup-action@v1
- name: Build and push docker image
uses: depot/build-push-action@v1
with:
context: .
platforms: linux/amd64,linux/arm64
tags: ${{ steps.docker_meta.outputs.tags }}
push: true
build-args: |
KERNEL_VERSION=${{ env.KERNEL_VERSION }}
TOOLCHAIN_CONFIG=configs/ct-ng-config${{ matrix.config }}
project: ${{ vars.DEPOT_PROJECT }}
token: ${{ secrets.DEPOT_TOKEN }}