-
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (44 loc) · 1.33 KB
/
build-and-test.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
53
54
55
56
name: Docker Build and Test
on:
workflow_dispatch:
pull_request:
paths-ignore:
- "**.md"
permissions:
contents: read
packages: write
jobs:
build-and-test:
name: Build and Test
if: ${{ github.actor != 'dependabot[bot]' }}
runs-on: ubuntu-latest
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 Test Docker images
# https://github.com/marketplace/actions/build-and-push-docker-images
- name: Build
uses: docker/[email protected]
with:
tags: |
ghcr.io/osinfra-io/gke-info-go:test
cache-from: type=gha
cache-to: type=gha,mode=max
load: true
- name: Test
run: |
docker run --rm ghcr.io/osinfra-io/gke-info-go:test go version