Skip to content

Commit

Permalink
Yaml fix and use variable for docker registry tag
Browse files Browse the repository at this point in the history
  • Loading branch information
mdeweerd committed Feb 29, 2024
1 parent 6511d70 commit f7e98f8
Showing 1 changed file with 19 additions and 24 deletions.
43 changes: 19 additions & 24 deletions .github/workflows/docker-image_new.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,28 @@
---
name: Docker Image CI

on:

Check warning on line 3 in .github/workflows/docker-image_new.yml

View workflow job for this annotation

GitHub Actions / workflows / YAMLLint

truthy value should be one of [false, true]
push:
branches: [ "meters-to-ha" ]
branches: [meters-to-ha]
pull_request:
branches: [ "meters-to-ha" ]

branches: [meters-to-ha]
jobs:

build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Build the Docker image
run: docker build . --file Dockerfile --tag my-image-name:$(date +%s)

- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- uses: actions/checkout@v4
- name: Build the Docker image
run: docker build . --file Dockerfile --tag my-image-name:$(date +%s)
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

# Production versions
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: true
tags: vingerha/meters2ha:latest
# Production versions
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ github.repository }}:latest

0 comments on commit f7e98f8

Please sign in to comment.