-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (43 loc) · 1.29 KB
/
buildx-ci.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
# https://docs.docker.com/ci-cd/github-actions/
name: buildx ci
on:
push:
branches:
- "main"
tags:
- "v*"
pull_request:
branches:
- "main"
env:
TESTING_TAG: ${{ secrets.DOCKERHUB_USERNAME }}/k0sctl-handler:test
RELEASE_TAG: ${{ secrets.DOCKERHUB_USERNAME }}/k0sctl-handler:latest
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2
- name: Login to DockerHub
uses: docker/login-action@327cd5a69de6c009b9ce71bce8395f28e651bf99
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and export to Docker
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4
with:
context: .
load: true
tags: ${{ env.TESTING_TAG }}
- name: Test
run: |
docker run --rm ${{ env.TESTING_TAG }}
- name: Build and push
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ env.RELEASE_TAG }}