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'
|
2021-06-08 22:03:04 +02:00
|
|
|
- 'requirements_optional.txt'
|
2021-04-08 17:08:11 +02:00
|
|
|
- 'requirements_test.txt'
|
|
|
|
- 'platformio.ini'
|
|
|
|
- '.github/workflows/docker-lint-build.yml'
|
|
|
|
|
|
|
|
jobs:
|
2021-07-15 21:30:04 +02:00
|
|
|
deploy-docker:
|
|
|
|
name: Build and publish docker containers
|
|
|
|
if: github.repository == 'esphome/esphome'
|
2021-04-08 17:08:11 +02:00
|
|
|
runs-on: ubuntu-latest
|
2021-07-15 21:30:04 +02:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
arch: [amd64, armv7, aarch64]
|
|
|
|
build_type: ["lint"]
|
2021-04-08 17:08:11 +02:00
|
|
|
steps:
|
2021-07-15 21:30:04 +02:00
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Set up Python
|
|
|
|
uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
python-version: '3.9'
|
|
|
|
- name: Set TAG
|
|
|
|
run: |
|
|
|
|
echo "TAG=1.1" >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- name: Run build
|
|
|
|
run: |
|
|
|
|
docker/build.py \
|
|
|
|
--tag "${TAG}" \
|
|
|
|
--arch "${{ matrix.arch }}" \
|
|
|
|
--build-type "${{ matrix.build_type }}" \
|
|
|
|
build
|
|
|
|
|
|
|
|
- name: Log in to docker hub
|
|
|
|
uses: docker/login-action@v1
|
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKER_USER }}
|
|
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
- name: Log in to the GitHub container registry
|
|
|
|
uses: docker/login-action@v1
|
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
|
|
- name: Run push
|
|
|
|
run: |
|
|
|
|
docker/build.py \
|
|
|
|
--tag "${TAG}" \
|
|
|
|
--arch "${{ matrix.arch }}" \
|
|
|
|
--build-type "${{ matrix.build_type }}" \
|
|
|
|
push
|
|
|
|
|
|
|
|
deploy-docker-manifest:
|
|
|
|
if: github.repository == 'esphome/esphome'
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: [deploy-docker]
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
build_type: ["lint"]
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Set up Python
|
|
|
|
uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
python-version: '3.9'
|
|
|
|
- name: Set TAG
|
|
|
|
run: |
|
|
|
|
echo "TAG=1.1" >> $GITHUB_ENV
|
|
|
|
- name: Enable experimental manifest support
|
|
|
|
run: |
|
|
|
|
mkdir -p ~/.docker
|
|
|
|
echo "{\"experimental\": \"enabled\"}" > ~/.docker/config.json
|
|
|
|
|
|
|
|
- name: Log in to docker hub
|
|
|
|
uses: docker/login-action@v1
|
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKER_USER }}
|
|
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
- name: Log in to the GitHub container registry
|
|
|
|
uses: docker/login-action@v1
|
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
|
|
- name: Run manifest
|
|
|
|
run: |
|
|
|
|
docker/build.py \
|
|
|
|
--tag "${TAG}" \
|
|
|
|
--build-type "${{ matrix.build_type }}" \
|
|
|
|
manifest
|