diff --git a/.gitea/workflows/build-publish.yaml b/.gitea/workflows/build-publish.yaml index b8173e5..5092ede 100644 --- a/.gitea/workflows/build-publish.yaml +++ b/.gitea/workflows/build-publish.yaml @@ -1,7 +1,11 @@ name: Build-Publish -run-name: Build and publish infmap Docker image +run-name: Build and publish infmap -on: [push] +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] defaults: run: @@ -68,3 +72,31 @@ jobs: echo "Manifest list created and pushed successfully" fi + + publish-template: + needs: [create-manifest] + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install dropshell + run: | + curl -fsSL https://getbin.xyz/dropshell-install | bash + ~/.local/bin/dropshell create-config + ~/.local/bin/dropshell install + + - name: Validate template + run: | + if ~/.local/bin/dropshell validate template; then + echo "Template validation passed" + else + echo "Template validation failed" + exit 1 + fi + + - name: Publish template + run: | + if [ "$GITHUB_REF" = "refs/heads/main" ]; then + SOS_WRITE_TOKEN=${{ secrets.SOS_WRITE_TOKEN }} ~/.local/bin/dropshell publish --all ./ + fi diff --git a/template/backup.sh b/infmap/backup.sh similarity index 100% rename from template/backup.sh rename to infmap/backup.sh diff --git a/template/config/infrastructure.conf b/infmap/config/infrastructure.conf similarity index 100% rename from template/config/infrastructure.conf rename to infmap/config/infrastructure.conf diff --git a/template/config/service.env b/infmap/config/service.env similarity index 100% rename from template/config/service.env rename to infmap/config/service.env diff --git a/template/destroy.sh b/infmap/destroy.sh similarity index 100% rename from template/destroy.sh rename to infmap/destroy.sh diff --git a/template/docker-compose.yml b/infmap/docker-compose.yml similarity index 100% rename from template/docker-compose.yml rename to infmap/docker-compose.yml diff --git a/template/install-pre.sh b/infmap/install-pre.sh similarity index 100% rename from template/install-pre.sh rename to infmap/install-pre.sh diff --git a/template/install.sh b/infmap/install.sh similarity index 100% rename from template/install.sh rename to infmap/install.sh diff --git a/template/logs.sh b/infmap/logs.sh similarity index 100% rename from template/logs.sh rename to infmap/logs.sh diff --git a/template/ports.sh b/infmap/ports.sh similarity index 100% rename from template/ports.sh rename to infmap/ports.sh diff --git a/template/restore.sh b/infmap/restore.sh similarity index 100% rename from template/restore.sh rename to infmap/restore.sh diff --git a/template/start.sh b/infmap/start.sh similarity index 100% rename from template/start.sh rename to infmap/start.sh diff --git a/template/status.sh b/infmap/status.sh similarity index 100% rename from template/status.sh rename to infmap/status.sh diff --git a/template/stop.sh b/infmap/stop.sh similarity index 100% rename from template/stop.sh rename to infmap/stop.sh diff --git a/template/template_info.env b/infmap/template_info.env similarity index 100% rename from template/template_info.env rename to infmap/template_info.env diff --git a/template/uninstall.sh b/infmap/uninstall.sh similarity index 100% rename from template/uninstall.sh rename to infmap/uninstall.sh