Docker Image CI #1159
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}} |