Skip to content

📦 Deploy pre-release to Docker with tag #2

📦 Deploy pre-release to Docker with tag

📦 Deploy pre-release to Docker with tag #2

#### Publish tags to docker hub
name: 📦 Deploy pre-release to Docker with tag
on:
workflow_dispatch:
inputs:
pre:
type: choice
description: Pre-release tag
required: true
options:
- alpha
- beta
- rc
jobs:
deploy_docker:
name: 📦 Deploy to Docker with tag
runs-on: ubuntu-latest
environment: CI - release environment
steps:
- name: 📤 Checkout the repository
uses: actions/checkout@main
- name: 📆 Set version number
run: |
echo setting source version: ${{ github.event.inputs.pre }}
sed -i '/ private const string Version = /c\ private const string Version = "${{ github.event.inputs.pre }}";' ${{github.workspace}}/src/Runtime/NetDaemon.Runtime/Internal/NetDaemonRuntime.cs
sed -i '/ io.hass.version=/c\ io.hass.version="${{ github.event.inputs.pre }}"' ${{github.workspace}}/Dockerfile.AddOn
- name: 📎 Set up QEMU
uses: docker/setup-qemu-action@v3
- name: 🔧 Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: 🧰 Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: 🔓 Login to Docker hub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: 🔓 Login to GitHub Container Registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: 🛠️ Run Buildx
run: |
docker buildx build \
--platform linux/arm,linux/arm64,linux/amd64 \
--output "type=image,push=true" \
--no-cache \
--file ./Dockerfile . \
--compress \
--tag "netdaemon/netdaemon4:${{ github.event.inputs.pre }}" \
--tag "ghcr.io/net-daemon/netdaemon4:${{ github.event.inputs.pre }}"
deploy_docker_addon:
name: 📦 Deploy to Docker add-on with tag
runs-on: ubuntu-latest
environment: CI - release environment
steps:
- name: 📤 Checkout the repository
uses: actions/checkout@main
- name: 📆 Set version number
run: |
echo setting source version: {{ github.event.inputs.pre }}
sed -i '/ private const string Version = /c\ private const string Version = "feature-${{ github.event.inputs.pre }}";' ${{github.workspace}}/src/Runtime/NetDaemon.Runtime/Internal/NetDaemonRuntime.cs
sed -i '/ io.hass.version=/c\ io.hass.version="feature-${{ github.event.inputs.pre }}"' ${{github.workspace}}/Dockerfile.AddOn
- name: 📎 Set up QEMU
uses: docker/setup-qemu-action@v1
- name: 🔧 Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: 🧰 Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: 🔓 Login to Docker hub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: 🔓 Login to GitHub Container Registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: 🛠️ Run Buildx
run: |
docker buildx build \
--platform linux/arm,linux/arm64,linux/amd64 \
--output "type=image,push=true" \
--no-cache \
--file ./Dockerfile.AddOn . \
--compress \
--tag "netdaemon/netdaemon_addon4:${{ github.event.inputs.pre }}" \
--tag "ghcr.io/net-daemon/netdaemon_addon4:${{ github.event.inputs.pre }}"