mirror of
https://github.com/esphome/home-assistant-addon.git
synced 2024-10-31 08:30:23 +01:00
Add devcontainer configuration (#62)
This commit is contained in:
parent
5b38efb502
commit
187ee4b9e4
10
.devcontainer/Dockerfile
Normal file
10
.devcontainer/Dockerfile
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
FROM ghcr.io/home-assistant/devcontainer:addons
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
apt-get update \
|
||||||
|
&& apt-get install -y --no-install-recommends \
|
||||||
|
python3-pip
|
||||||
|
|
||||||
|
COPY script/requirements.txt /
|
||||||
|
|
||||||
|
RUN pip install -r /requirements.txt
|
36
.devcontainer/devcontainer.json
Normal file
36
.devcontainer/devcontainer.json
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
{
|
||||||
|
"name": "ESPHome Home Assistant add-on devcontainer",
|
||||||
|
"image": "ghcr.io/esphome/devcontainer:addons",
|
||||||
|
"appPort": [
|
||||||
|
"7123:8123",
|
||||||
|
"7357:4357"
|
||||||
|
],
|
||||||
|
"postStartCommand": "bash devcontainer_bootstrap",
|
||||||
|
"runArgs": [
|
||||||
|
"-e",
|
||||||
|
"GIT_EDITOR=code --wait",
|
||||||
|
"--privileged"
|
||||||
|
],
|
||||||
|
"containerEnv": {
|
||||||
|
"WORKSPACE_DIRECTORY": "${containerWorkspaceFolder}"
|
||||||
|
},
|
||||||
|
"extensions": [
|
||||||
|
"timonwong.shellcheck",
|
||||||
|
"esbenp.prettier-vscode"
|
||||||
|
],
|
||||||
|
"mounts": [
|
||||||
|
"type=volume,target=/var/lib/docker"
|
||||||
|
],
|
||||||
|
"settings": {
|
||||||
|
"terminal.integrated.profiles.linux": {
|
||||||
|
"zsh": {
|
||||||
|
"path": "/usr/bin/zsh"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"terminal.integrated.defaultProfile.linux": "zsh",
|
||||||
|
"editor.formatOnPaste": false,
|
||||||
|
"editor.formatOnSave": true,
|
||||||
|
"editor.formatOnType": true,
|
||||||
|
"files.trimTrailingWhitespace": true
|
||||||
|
}
|
||||||
|
}
|
41
.github/workflows/devcontainer-build.yaml
vendored
Normal file
41
.github/workflows/devcontainer-build.yaml
vendored
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
name: Build devcontainer image
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
paths:
|
||||||
|
- .devcontainer/**
|
||||||
|
schedule:
|
||||||
|
- cron: '0 0 1 * *'
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
paths:
|
||||||
|
- .devcontainer/**
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3.1.0
|
||||||
|
- name: Log in to the GitHub container registry
|
||||||
|
uses: docker/login-action@v2.1.0
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.repository_owner }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v2.1.0
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v2.2.1
|
||||||
|
- name: Build and Push
|
||||||
|
uses: docker/build-push-action@v3.2.0
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: .devcontainer/Dockerfile
|
||||||
|
tags: ghcr.io/${{ github.repository_owner }}/devcontainer:addons
|
||||||
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
|
platforms: linux/amd64,linux/arm64
|
19
.vscode/tasks.json
vendored
Normal file
19
.vscode/tasks.json
vendored
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"version": "2.0.0",
|
||||||
|
"tasks": [
|
||||||
|
{
|
||||||
|
"label": "Start Home Assistant",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "supervisor_run",
|
||||||
|
"group": {
|
||||||
|
"kind": "test",
|
||||||
|
"isDefault": true
|
||||||
|
},
|
||||||
|
"presentation": {
|
||||||
|
"reveal": "always",
|
||||||
|
"panel": "new"
|
||||||
|
},
|
||||||
|
"problemMatcher": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user