Skip to content

Docker Image CI

Docker Image CI #1153

Workflow file for this run

name: Docker Image CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: '0 1 * * *'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Get and Set Date used for tags
id: date
run: echo "::set-output name=date::$(date +'%Y.%m.%d')"
- name: Build the Docker image
run: docker build . --file Dockerfile --tag compsecdirect/autodyne:$(date +%Y.%m.%d) --tag compsecdirect/autodyne:latest
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Push the lastest image to docker hub
id: docker_build_latest
uses: docker/build-push-action@v2
with:
push: true
tags: compsecdirect/autodyne:latest
- name: Push the daily image to docker hub
id: docker_build_daily
uses: docker/build-push-action@v2
with:
push: true
tags: compsecdirect/autodyne:${{steps.date.outputs.date}}