2022-12-17 00:46:24 +00: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 02:12:16 +00:00
|
|
|
- name: Login to Docker Hub
|
2023-01-05 15:54:14 +00:00
|
|
|
uses: docker/login-action@v2
|
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
2023-02-07 02:12:16 +00:00
|
|
|
- name: Setup Go
|
2022-12-17 00:46:24 +00:00
|
|
|
uses: actions/setup-go@main
|
|
|
|
with:
|
2023-02-08 13:32:42 +00:00
|
|
|
go-version: 1.20.0
|
2022-12-17 00:46:24 +00:00
|
|
|
id: go
|
2023-02-07 02:12:16 +00:00
|
|
|
|
|
|
|
- name: Setup docker scan
|
2022-12-19 23:22:45 +00: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 02:12:16 +00:00
|
|
|
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v2
|
|
|
|
|
|
|
|
- name: Code checkout
|
2022-12-17 00:46:24 +00:00
|
|
|
uses: actions/checkout@master
|
2023-02-07 02:12:16 +00: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 00:46:24 +00:00
|
|
|
run: |
|
2023-02-07 02:12:16 +00:00
|
|
|
docker scan --login --token "$SNYK_TOKEN" --accept-license
|
2022-12-17 00:46:24 +00:00
|
|
|
LATEST_TAG=nightly PKG_TAG=nightly make publish
|
2023-02-07 02:12:16 +00:00
|
|
|
env:
|
|
|
|
SNYK_TOKEN: ${{ secrets.SNYK_AUTH_TOKEN }}
|