Skip to content

Nightly Docker Image CI #718

Nightly Docker Image CI

Nightly Docker Image CI #718

name: Nightly Docker Image CI
on:
schedule:
- cron: "0 0 * * *" # build nightly!
jobs:
build:
runs-on: ubuntu-latest
steps:
-
name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@master
-
name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-${{ github.sha }}
-
name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
-
name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
context: ./
file: ./Dockerfile
builder: ${{ steps.buildx.outputs.name }}
push: true
tags: tonimoreno/snmpcollector:nightly
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
-
name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}