2022-12-17 01:46:24 +01:00
|
|
|
name: nightly-build
|
|
|
|
on:
|
|
|
|
schedule:
|
|
|
|
# Daily at 2:48am
|
|
|
|
- cron: '48 2 * * *'
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: Build
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-02-07 03:12:16 +01:00
|
|
|
- name: Login to Docker Hub
|
2023-01-05 16:54:14 +01:00
|
|
|
uses: docker/login-action@v2
|
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
2023-02-07 03:12:16 +01:00
|
|
|
- name: Setup Go
|
2022-12-17 01:46:24 +01:00
|
|
|
uses: actions/setup-go@main
|
|
|
|
with:
|
2023-03-09 13:20:54 +01:00
|
|
|
go-version: 1.20.2
|
2022-12-17 01:46:24 +01:00
|
|
|
id: go
|
2023-02-07 03:12:16 +01:00
|
|
|
|
|
|
|
- name: Setup docker scan
|
2022-12-20 00:22:45 +01:00
|
|
|
run: |
|
|
|
|
mkdir -p ~/.docker/cli-plugins && \
|
|
|
|
curl https://github.com/docker/scan-cli-plugin/releases/latest/download/docker-scan_linux_amd64 -L -s -S -o ~/.docker/cli-plugins/docker-scan &&\
|
|
|
|
chmod +x ~/.docker/cli-plugins/docker-scan
|
2023-02-07 03:12:16 +01:00
|
|
|
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v2
|
|
|
|
|
|
|
|
- name: Code checkout
|
2022-12-17 01:46:24 +01:00
|
|
|
uses: actions/checkout@master
|
2023-02-07 03:12:16 +01:00
|
|
|
|
|
|
|
- uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: gocache-for-docker
|
|
|
|
key: gocache-docker-${{ runner.os }}-${{ steps.go.outputs.go-version }}-${{ hashFiles('go.mod') }}
|
|
|
|
|
|
|
|
- name: build & publish
|
2022-12-17 01:46:24 +01:00
|
|
|
run: |
|
2023-02-09 23:25:01 +01:00
|
|
|
docker scan --severity=medium --login --token "$SNYK_TOKEN" --accept-license
|
2022-12-17 01:46:24 +01:00
|
|
|
LATEST_TAG=nightly PKG_TAG=nightly make publish
|
2023-02-07 03:12:16 +01:00
|
|
|
env:
|
|
|
|
SNYK_TOKEN: ${{ secrets.SNYK_AUTH_TOKEN }}
|