Skip to content

Commit

Permalink
Create nightly-docker-image.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
toni-moreno authored and Toni Moreno Gimenez committed Mar 22, 2021
1 parent 0471ea6 commit dcd8214
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/nightly-docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Nightly Docker Image CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
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
-
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 }}

0 comments on commit dcd8214

Please sign in to comment.