Files
automation_rs/.gitea/workflows/build.yml
T
Dreaded_X 9d4c059d29
Build and deploy / Build container and manifests (push) Failing after 10m45s
Build and deploy / build (push) Failing after 10m46s
Build and deploy / Deploy container (push) Skipped
chore(deps): Update workflow
2026-08-26 03:05:56 +02:00

52 lines
1.8 KiB
YAML

name: Build and deploy
on:
push:
branches:
- master
- feature/**
tags:
- v*.*.*
jobs:
build:
uses: infra/workflows/.gitea/workflows/docker.yaml@98c75f5e7827d3754f0e73d08c971e1b8916f31b
secrets: inherit
with:
push_manifests: false
deploy:
name: Deploy container
runs-on: ubuntu-latest
container: catthehacker/ubuntu:act-latest
needs: build
if: gitea.ref == 'refs/heads/master'
steps:
- name: Stop and remove current container
run: |
docker stop automation_rs || true
docker rm automation_rs || true
- name: Login to registry
run: |
docker login git.huizinga.dev -u ${{ gitea.actor }} -p ${{ secrets.REGISTRY_TOKEN }} \
- name: Create container
run: |
docker create \
--pull always \
--restart unless-stopped \
--name automation_rs \
--network mqtt \
-e RUST_LOG=automation=debug \
-e AUTOMATION__SECRETS__MQTT_PASSWORD=${{ secrets.MQTT_PASSWORD }} \
-e AUTOMATION__SECRETS__HUE_TOKEN=${{ secrets.HUE_TOKEN }} \
-e AUTOMATION__SECRETS__NTFY_TOPIC=${{ secrets.NTFY_TOPIC }} \
-e AUTOMATION__SECRETS__PRINTER_DEVICE_ID=${{ secrets.PRINTER_DEVICE_ID }} \
-e AUTOMATION__SECRETS__PRINTER_ACCESS_CODE=${{ secrets.PRINTER_ACCESS_CODE }} \
$(echo ${{ toJSON(needs.build.outputs.images) }} | jq .automation -r)
docker network connect web automation_rs
- name: Start container
run: docker start automation_rs