Skip to content

Commit

Permalink
Add version argument (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
jesserockz committed Jun 2, 2022
1 parent 1b754d8 commit 8eb20c1
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 5 deletions.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM ghcr.io/esphome/esphome:latest
ARG VERSION=latest

FROM ghcr.io/esphome/esphome:${VERSION}

COPY entrypoint.py /entrypoint.py

Expand Down
29 changes: 25 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,37 @@ inputs:
description: YAML file to use
required: true
type: string
version:
description: Version of ESPHome to build
required: false
type: string
default: latest

outputs:
name:
description: Name of device extracted from configuration

runs:
using: docker
image: Dockerfile
args:
- ${{ inputs.yaml_file }}
using: composite
steps:
- name: Build ESPHome image
shell: bash
run: |-
docker build \
-t esphome:${{ inputs.version }} \
--build-arg VERSION=${{ inputs.version }} \
${{ github.action_path }}
- name: Run container
shell: bash
run: |-
docker run --rm \
--workdir /github/workspace -v "$(pwd)":"/github/workspace" \
-e INPUT_YAML_FILE -e HOME -e GITHUB_JOB -e GITHUB_REF \
-e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER \
-e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_ACTOR \
-e GITHUB_ACTIONS=true -e CI=true \
esphome:${{ inputs.version }} \
${{ inputs.yaml_file }}
branding:
icon: 'archive'
Expand Down

0 comments on commit 8eb20c1

Please sign in to comment.