-
Notifications
You must be signed in to change notification settings - Fork 13
68 lines (64 loc) · 2.16 KB
/
docker-build.yaml
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
68
name: Docker Image CI
on:
push:
branches: [ main ]
tags: [ '*' ]
pull_request:
branches: [ main ]
permissions:
# Required for requesting the GitHub Token
id-token: write
# Required for pushing images to GitHub Container Registry
packages: write
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
buildx:
runs-on: nscloud
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
-
# Install CLI and authenticate to Namespace
name: Install and configure Namespace CLI
uses: namespacelabs/nscloud-setup@v0
-
# Setup docker build to use your Namespace workspace builder
name: Set up Namespace Buildx
uses: namespacelabs/nscloud-setup-buildx-action@v0
# TODO: make builds from latest main branch conditional
# - name: Build runwasi as static muls for amd64 and arm64
# run: |
# git clone --branch main --depth 1 https://github.com/containerd/runwasi.git &&
# cd runwasi &&
# docker build --platform=linux/arm64,linux/amd64 --build-arg BASE_IMAGE=alpine --build-arg CRATE="containerd-shim-wasmtime,containerd-shim-wasmedge,containerd-shim-wasmer" -t nscr.io/a8fcp47vcfori/build-runwasi --push . &&
# cd -
-
name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
# build-args: |
# CONTAINERD_RUNWASI=nscr.io/a8fcp47vcfori/build-runwasi
tags: ${{ steps.meta.outputs.tags }}
file: images/installer/Dockerfile
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max