Skip to content

Commit ff2c550

Browse files
committed
.github/workflows: add action to publish docker images
1 parent 4c3a690 commit ff2c550

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

.github/workflows/docker.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Build docker image
2+
on:
3+
push:
4+
tags:
5+
- v*
6+
env:
7+
REGISTRY: ghcr.io
8+
IMAGE_NAME: flatcar-linux/ct
9+
10+
jobs:
11+
docker:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
15+
packages: write
16+
steps:
17+
18+
- name: Get tag name
19+
id: meta
20+
uses: docker/metadata-action@v3
21+
with:
22+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
23+
24+
- name: Checkout repository
25+
uses: actions/checkout@v2
26+
27+
- name: Setup QEMU
28+
uses: docker/setup-qemu-action@v1
29+
with:
30+
platforms: all
31+
32+
- name: Set up Docker Buildx
33+
uses: docker/setup-buildx-action@v1
34+
35+
- name: Login to registry
36+
uses: docker/login-action@v1
37+
with:
38+
registry: ${{ env.REGISTRY }}
39+
username: ${{ github.actor }}
40+
password: ${{ secrets.GITHUB_TOKEN }}
41+
42+
- name: Build and push
43+
uses: docker/build-push-action@v2
44+
with:
45+
context: .
46+
push: true
47+
platforms: linux/amd64,linux/arm64/v8
48+
tags: ${{ steps.meta.outputs.tags }}
49+
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)