-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Yaml fix and use variable for docker registry tag
- Loading branch information
Showing
1 changed file
with
19 additions
and
24 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,28 @@ | ||
--- | ||
name: Docker Image CI | ||
|
||
on: | ||
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 |