-
-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (41 loc) · 1.37 KB
/
build-and-push.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
47
48
49
50
51
52
name: Docker Build and Push
on:
release:
types: [published]
permissions:
contents: read
packages: write
jobs:
build-and-push:
name: Build and Push GKE Info Go
runs-on: ubuntu-latest
env:
VERSION: ${{ github.event.release.tag_name }}
steps:
# Checkout
# https://github.com/marketplace/actions/checkout
- name: Checkout
uses: actions/checkout@v4
# Docker Buildx
# https://github.com/marketplace/actions/docker-setup-buildx
- name: Set up Docker Buildx
uses: docker/[email protected]
# Docker Login
# https://github.com/marketplace/actions/docker-login
- name: Login to GitHub Container Registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Build and Push Docker to GitHub Container Registry
# https://github.com/marketplace/actions/build-and-push-docker-images
- name: Build and Push GitHub Container Registry
uses: docker/[email protected]
with:
tags: |
ghcr.io/osinfra-io/gke-info-go:${{ env.VERSION }}
ghcr.io/osinfra-io/gke-info-go:latest
cache-from: type=registry,ref=ghcr.io/osinfra-io/gke-info-go:latest
cache-to: type=inline
push: true