Skip to content

Commit 15523e0

Browse files
committed
ci(build): use docker buildx
1 parent 88ea1c0 commit 15523e0

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

.github/workflows/build.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,23 @@ jobs:
4646
password: ${{ secrets.DOCKER_TOKEN }}
4747

4848
- name: Build
49+
uses: docker/build-push-action@v6
50+
with:
51+
context: .
52+
build-args: |
53+
VERSION=$(git describe --tags --dirty --always --abbrev=12)
54+
push: false
55+
load: true
56+
tags: rootfsimage
57+
cache-from: type=gha
58+
cache-to: type=gha,mode=max
59+
60+
- name: Export
4961
run: |
50-
docker buildx build --pull --tag rootfsimage --build-arg VERSION=$(git describe --tags --dirty --always --abbrev=12) .
5162
id=$(docker create rootfsimage true)
5263
mkdir -p ./plugin/rootfs/
53-
docker export "$id" | tar -x -C ./plugin/rootfs/
5464
cp config.json ./plugin/
65+
docker export "$id" | tar -x -C ./plugin/rootfs/
5566
docker rm -vf "$id"
5667
5768
- name: Publish latest
@@ -63,4 +74,6 @@ jobs:
6374
- name: Publish tagged
6475
if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') }}
6576
run: |
77+
docker plugin rm "docker.io/${{ secrets.DOCKER_USERNAME }}/opsd" || true
78+
docker plugin create "docker.io/${{ secrets.DOCKER_USERNAME }}/opsd:${{ github.ref_name }}" ${PWD}/plugin
6679
docker plugin push "docker.io/${{ secrets.DOCKER_USERNAME }}/opsd:${{ github.ref_name }}" ${PWD}/plugin

0 commit comments

Comments
 (0)