📦 Deploy pre-release to Docker with tag #5
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#### 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 pre-release 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@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.AddOn . \ | |
--compress \ | |
--tag "netdaemon/netdaemon_addon4:${{ github.event.inputs.pre }}" \ | |
--tag "ghcr.io/net-daemon/netdaemon_addon4:${{ github.event.inputs.pre }}" |