-
-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added possibility to do pre-releases of docker containers
- Loading branch information
1 parent
4d5e188
commit e7b8487
Showing
1 changed file
with
97 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
|
||
#### 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/login-action@v1.10.0 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_TOKEN }} | ||
- name: 🔓 Login to GitHub Container Registry | ||
uses: docker/login-action@v1.10.0 | ||
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/netdaemon:${{ github.event.inputs.pre }}" \ | ||
--tag "ghcr.io/net-daemon/netdaemon:${{ 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/login-action@v1.10.0 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_TOKEN }} | ||
- name: 🔓 Login to GitHub Container Registry | ||
uses: docker/login-action@v1.10.0 | ||
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_addon:${{ github.event.inputs.pre }}" \ | ||
--tag "ghcr.io/net-daemon/netdaemon_addon:${{ github.event.inputs.pre }}" |