-
Notifications
You must be signed in to change notification settings - Fork 18
106 lines (92 loc) · 3.62 KB
/
docker-image-testing.yaml
File metadata and controls
106 lines (92 loc) · 3.62 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: Build and Publish Testing
permissions:
contents: read
packages: write
on:
workflow_dispatch:
push:
branches:
- develop
jobs:
build:
runs-on: ubuntu-latest
env:
GO111MODULE: on
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Go
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
with:
go-version: '1.26'
- name: Run Gosec Security Scanner
run: |
go install github.com/securego/gosec/v2/cmd/gosec@v2.23.0
gosec ./...
- name: Run Go tests
run: go test ./...
# - name: Install Cosign
# uses: sigstore/cosign-installer@v3.10.0
# with:
# cosign-release: 'v2.6.0'
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
- name: Login to Docker Hub
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push image to Docker Hub and GHCR
uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7.0.0
id: push-all
with:
context: .
platforms: linux/amd64,linux/arm/v7,linux/arm64
push: true
build-args: VERSION=testing-${{ github.sha }}
tags: |
docker.io/wollomatic/socket-proxy:testing
docker.io/wollomatic/socket-proxy:testing-${{ github.sha }}
ghcr.io/wollomatic/socket-proxy:testing
ghcr.io/wollomatic/socket-proxy:testing-${{ github.sha }}
# - name: Build and push Docker Hub image
# uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7.0.0
# id: push-dockerhub
# with:
# context: .
# platforms: linux/amd64,linux/arm/v7,linux/arm64
# push: true
# build-args: VERSION=testing-${{ github.sha }}
# tags: |
# docker.io/wollomatic/socket-proxy:testing
# docker.io/wollomatic/socket-proxy:testing-${{ github.sha }}
#
# - name: Sign Docker Hub image
# run: cosign sign --yes --recursive --key env://COSIGN_PRIVATE_KEY docker.io/wollomatic/socket-proxy:testing-${{ github.sha }}@${{ steps.push-dockerhub.outputs.digest }}
# env:
# COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }}
# COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}
#
# - name: Build and push GHCR image
# uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7.0.0
# id: push-ghcr
# with:
# context: .
# platforms: linux/amd64,linux/arm/v7,linux/arm64
# push: true
# build-args: VERSION=testing-${{ github.sha }}
# tags: |
# ghcr.io/wollomatic/socket-proxy:testing
# ghcr.io/wollomatic/socket-proxy:testing-${{ github.sha }}
#
# - name: Sign GHCR image
# run: cosign sign --yes --recursive --key env://COSIGN_PRIVATE_KEY ghcr.io/wollomatic/socket-proxy:testing-${{ github.sha }}@${{ steps.push-ghcr.outputs.digest }}
# env:
# COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }}
# COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}