-
-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'development' into new-release
- Loading branch information
Showing
2 changed files
with
61 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: Build Docker Image | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
branch: | ||
description: 'Branch to build from' | ||
required: true | ||
type: choice | ||
default: 'master' | ||
options: | ||
- 'master' | ||
- 'development' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ github.event.inputs.branch }} | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Load Buildx | ||
run: docker buildx create --name mybuilder --use | ||
if: runner.os == 'Linux' | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/#-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_ACCESS_TOKEN }} | ||
|
||
- name: Extract version from package.json | ||
if: ${{ github.event.inputs.branch == 'master' }} | ||
run: echo "DOCKER_TAG=$(jq -r '.version' package.json)" >> $GITHUB_ENV | ||
|
||
- name: Build and push production Docker image | ||
if: ${{ github.event.inputs.branch == 'master' }} | ||
run: | | ||
docker buildx build \ | ||
--platform linux/amd64,linux/arm64,linux/arm/v7 \ | ||
-t benzino77/tasmocompiler:$DOCKER_TAG \ | ||
-t benzino77/tasmocompiler:latest \ | ||
-f Dockerfile --push . | ||
- name: Build and push development Docker image | ||
if: ${{ github.event.inputs.branch == 'development' }} | ||
run: | | ||
docker buildx build \ | ||
--platform linux/amd64,linux/arm64,linux/arm/v7 \ | ||
-t benzino77/tasmocompiler:development \ | ||
-f Dockerfile --push . |
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