Update docker-image.yml

This commit is contained in:
Tigerblue77 2022-04-13 14:39:06 +02:00 committed by GitHub
parent 7b0b894823
commit 3421ced8d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,12 +7,32 @@ on:
branches: [ master ] branches: [ master ]
jobs: jobs:
docker:
build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - name: Checkout
- name: Build the Docker image uses: actions/checkout@v3
run: docker build . --file Dockerfile --tag my-image-name:$(date +%s)
#- name: Build the Docker image
# run: docker build . --file Dockerfile --tag dell_idrac_fan_controller:$(date +%s)
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: tigerblue77/dell_idrac_fan_controller
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}