forked from deislabs/containerd-wasm-shims
-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (78 loc) · 2.75 KB
/
docker-build-push.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
69
70
71
72
73
74
75
76
77
78
name: 'Build and push Docker images'
on:
workflow_call:
inputs:
test:
description: 'Is this a test run?'
type: boolean
required: true
jobs:
build_and_push:
permissions:
contents: write
packages: write
runs-on: ubuntu-latest
strategy:
matrix:
image:
- imageName: examples/spin-rust-hello
context: images/spin
- imageName: examples/spin-dotnet-hello
context: images/spin_dotnet
- imageName: examples/slight-rust-hello
context: images/slight
- imageName: examples/wws-js-hello
context: images/wws
- imageName: examples/spin-inbound-redis
context: images/spin-inbound-redis
- imageName: examples/spin-outbound-redis
context: images/spin-outbound-redis
- imageName: examples/lunatic-rust-hello
context: images/lunatic
- imageName: examples/lunatic-spawn
context: images/lunatic-spawn
- imageName: examples/lunatic-submillisecond
context: images/lunatic-submillisecond
steps:
- uses: actions/checkout@v3
- name: Set RELEASE_VERSION ENV var
run: echo "RELEASE_VERSION=${GITHUB_REF:10}" >> $GITHUB_ENV
- name: lowercase the runner OS name
shell: bash
run: |
OS=$(echo "${{ runner.os }}" | tr '[:upper:]' '[:lower:]')
echo "RUNNER_OS=$OS" >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: setup buildx
uses: docker/setup-buildx-action@v2
- name: login to GitHub container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: enable containerd image store
run: |
echo '{ "features": { "containerd-snapshotter": true } }' | sudo tee /etc/docker/daemon.json
sudo systemctl restart docker
docker info -f '{{ .DriverStatus }}'
- name: test
uses: docker/build-push-action@v5
if: ${{ inputs.test }}
with:
context: ${{ matrix.image.context }}
load: true
tags: containerd-wasm-shims${{ matrix.image.imageName }}:test
platforms: wasi/wasm
- name: build and push
uses: docker/build-push-action@v5
if: ${{ !inputs.test }}
with:
push: true
tags: |
ghcr.io/${{ github.repository }}/${{ matrix.image.imageName }}:${{ env.RELEASE_VERSION }}
ghcr.io/${{ github.repository }}/${{ matrix.image.imageName }}:latest
context: ${{ matrix.image.context }}
platforms: wasi/wasm
provenance: false