2021-04-08 17:08:11 +02:00
|
|
|
name: Build and publish lint docker image
|
|
|
|
|
|
|
|
# Only run when docker paths change
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [dev]
|
|
|
|
paths:
|
|
|
|
- 'docker/Dockerfile.lint'
|
|
|
|
- 'requirements.txt'
|
|
|
|
- 'requirements_test.txt'
|
|
|
|
- 'platformio.ini'
|
|
|
|
- '.github/workflows/docker-lint-build.yml'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
publish-docker-lint-iage:
|
|
|
|
name: Build docker containers
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2021-06-08 21:28:19 +02:00
|
|
|
- name: Set TAG
|
|
|
|
run: |
|
|
|
|
echo "TAG=1.0" >> $GITHUB_ENV
|
2021-04-08 17:08:11 +02:00
|
|
|
- name: Pull for cache
|
|
|
|
run: |
|
|
|
|
docker pull "esphome/esphome-lint:latest" || true
|
|
|
|
- name: Build
|
|
|
|
run: |
|
|
|
|
docker build \
|
|
|
|
--cache-from "esphome/esphome-lint:latest" \
|
|
|
|
--file "docker/Dockerfile.lint" \
|
|
|
|
--tag "esphome/esphome-lint:latest" \
|
2021-06-08 21:28:19 +02:00
|
|
|
--tag "esphome/esphome-lint:${TAG}" \
|
2021-04-08 17:08:11 +02:00
|
|
|
.
|
|
|
|
- name: Log in to docker hub
|
|
|
|
env:
|
|
|
|
DOCKER_USER: ${{ secrets.DOCKER_USER }}
|
|
|
|
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
run: docker login -u "${DOCKER_USER}" -p "${DOCKER_PASSWORD}"
|
|
|
|
- run: |
|
2021-06-08 21:28:19 +02:00
|
|
|
docker push "esphome/esphome-lint:${TAG}"
|
2021-04-08 17:08:11 +02:00
|
|
|
docker push "esphome/esphome-lint:latest"
|