-
Notifications
You must be signed in to change notification settings - Fork 2
41 lines (39 loc) · 1.26 KB
/
build.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
name: Build and push Docker image
on:
push:
branches:
- main
tags:
- '*'
jobs:
build-image:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
pull: true
file: docker/Dockerfile
build-args: |
VERSION_FLAGS=-ldflags=-X main.buildVersion=${{ github.ref_name }} -X main.buildTime=${{ steps.date.outputs.date }}
tags: ghcr.io/stackpath/virtual-kubelet-stackpath:${{ github.ref_name }}
labels: org.opencontainers.image.source=https://github.com/stackpath/virtual-kubelet-stackpath