Changing workflow secrets.

This commit is contained in:
2025-09-23 20:20:21 -04:00
parent 16c5005791
commit 7bc3e1233f
2 changed files with 72 additions and 67 deletions
+66 -61
View File
@@ -4,15 +4,15 @@ on:
workflow_dispatch: workflow_dispatch:
push: push:
branches-ignore: branches-ignore:
- 'main' - "main"
- 'renovate/**' - "renovate/**"
paths: paths:
- '**/docker-compose.yml' - "**/docker-compose.yml"
- '**/pr-docker-deploy.yml' - "**/pr-docker-deploy.yml"
env: env:
HC_VAULT_VERSION: '1.20.0' HC_VAULT_VERSION: "1.20.0"
TEA_VERSION: '0.10.1' TEA_VERSION: "0.10.1"
jobs: jobs:
check-and-create-pr: check-and-create-pr:
@@ -42,16 +42,16 @@ jobs:
- name: Gotify Notification - name: Gotify Notification
uses: eikendev/gotify-action@master uses: eikendev/gotify-action@master
with: with:
gotify_api_base: '${{ secrets.RIKKU_GOTIFY_URL }}' gotify_api_base: "${{ secrets.RUNNER_GOTIFY_URL }}"
gotify_app_token: '${{ secrets.RIKKU_RUNNER_GOTIFY_TOKEN }}' gotify_app_token: "${{ secrets.RUNNER_GOTIFY_TOKEN }}"
notification_title: 'GITEA: PR Check' notification_title: "GITEA: PR Check"
notification_message: 'Checking for existing PR... 🔍' notification_message: "Checking for existing PR... 🔍"
- name: Check if open PR exists - name: Check if open PR exists
id: check-opened-pr-step id: check-opened-pr-step
continue-on-error: true continue-on-error: true
run: | run: |
tea login add --name gitea-rinoa --url "${{ secrets.RIKKU_GITEA_URL }}" --user gitea-sonarqube-bot --password "${{ secrets.BOT_GITEA_PASSWORD }}" --token ${{ secrets.BOT_GITEA_TOKEN }} tea login add --name gitea-rinoa --url "${{ secrets.TREZ_GITEA_URL }}" --user gitea-sonarqube-bot --password "${{ secrets.BOT_GITEA_PASSWORD }}" --token ${{ secrets.BOT_GITEA_TOKEN }}
pr_exists=$(tea pr list --repo ${{ github.repository }} --state open --fields index,title,head | egrep '\[HA\].*${{ github.ref_name }}' | tail -1 | wc -l) pr_exists=$(tea pr list --repo ${{ github.repository }} --state open --fields index,title,head | egrep '\[HA\].*${{ github.ref_name }}' | tail -1 | wc -l)
echo "exists=$pr_exists" >> $GITHUB_OUTPUT echo "exists=$pr_exists" >> $GITHUB_OUTPUT
@@ -66,10 +66,10 @@ jobs:
- name: Gotify Notification - name: Gotify Notification
uses: eikendev/gotify-action@master uses: eikendev/gotify-action@master
with: with:
gotify_api_base: '${{ secrets.RIKKU_GOTIFY_URL }}' gotify_api_base: "${{ secrets.RUNNER_GOTIFY_URL }}"
gotify_app_token: '${{ secrets.RIKKU_RUNNER_GOTIFY_TOKEN }}' gotify_app_token: "${{ secrets.RUNNER_GOTIFY_TOKEN }}"
notification_title: 'GITEA: PR Check' notification_title: "GITEA: PR Check"
notification_message: 'PR Created 🎟️' notification_message: "PR Created 🎟️"
generate-service-list: generate-service-list:
name: Generate list of added/modified/deleted services name: Generate list of added/modified/deleted services
@@ -88,10 +88,10 @@ jobs:
- name: Gotify Notification - name: Gotify Notification
uses: eikendev/gotify-action@master uses: eikendev/gotify-action@master
with: with:
gotify_api_base: '${{ secrets.RIKKU_GOTIFY_URL }}' gotify_api_base: "${{ secrets.RUNNER_GOTIFY_URL }}"
gotify_app_token: '${{ secrets.RIKKU_RUNNER_GOTIFY_TOKEN }}' gotify_app_token: "${{ secrets.RUNNER_GOTIFY_TOKEN }}"
notification_title: 'GITEA: Services TBD' notification_title: "GITEA: Services TBD"
notification_message: 'Generating list of services to deploy...' notification_message: "Generating list of services to deploy..."
- name: Save both versions of docker-compose.yml - name: Save both versions of docker-compose.yml
run: | run: |
@@ -137,7 +137,7 @@ jobs:
needs: [generate-service-list] needs: [generate-service-list]
runs-on: ubuntu-latest runs-on: ubuntu-latest
env: env:
VAULT_ADDR: ${{ secrets.RIKKU_VAULT_ADDR }} VAULT_ADDR: ${{ secrets.TREZ_VAULT_ADDR }}
VAULT_TOKEN: ${{ secrets.VAULT_GITEA_TOKEN }} VAULT_TOKEN: ${{ secrets.VAULT_GITEA_TOKEN }}
VAULT_NAMESPACE: "" VAULT_NAMESPACE: ""
RIKKU_REGISTRY_PASSWORD: ${{ secrets.BOT_GITEA_PASSWORD }} RIKKU_REGISTRY_PASSWORD: ${{ secrets.BOT_GITEA_PASSWORD }}
@@ -172,10 +172,10 @@ jobs:
- name: Gotify Notification - name: Gotify Notification
uses: eikendev/gotify-action@master uses: eikendev/gotify-action@master
with: with:
gotify_api_base: '${{ secrets.RIKKU_GOTIFY_URL }}' gotify_api_base: "${{ secrets.RUNNER_GOTIFY_URL }}"
gotify_app_token: '${{ secrets.RIKKU_RUNNER_GOTIFY_TOKEN }}' gotify_app_token: "${{ secrets.RUNNER_GOTIFY_TOKEN }}"
notification_title: 'GITEA: Docker Compose Dry Run @ Rikku' notification_title: "GITEA: Docker Compose Dry Run @ Rikku"
notification_message: 'Starting Docker Compose dry run...' notification_message: "Starting Docker Compose dry run..."
- name: Generate .env file for Docker Compose - name: Generate .env file for Docker Compose
run: | run: |
@@ -186,13 +186,13 @@ jobs:
with: with:
mode: compose mode: compose
file: docker-compose.yml file: docker-compose.yml
name: 'rikku' name: "rikku"
host: 192.168.1.252 host: 192.168.1.252
user: pi user: pi
ssh_key: ${{ secrets.RIKKU_SSH_PRIVATE_KEY }} ssh_key: ${{ secrets.RUNNER_SSH_PRIVATE_KEY }}
args: --remove-orphans -d --dry-run ${{ needs.generate-service-list.outputs.svc_deploy_list }} args: --remove-orphans -d --dry-run ${{ needs.generate-service-list.outputs.svc_deploy_list }}
env_file: '.env' env_file: ".env"
registry_host: 'ghcr.io' registry_host: "ghcr.io"
registry_user: TrezOne registry_user: TrezOne
registry_pass: ${{ secrets.GHCR_LOGIN_TOKEN }} registry_pass: ${{ secrets.GHCR_LOGIN_TOKEN }}
summary: true summary: true
@@ -200,10 +200,10 @@ jobs:
- name: Gotify Notification - name: Gotify Notification
uses: eikendev/gotify-action@master uses: eikendev/gotify-action@master
with: with:
gotify_api_base: '${{ secrets.RIKKU_GOTIFY_URL }}' gotify_api_base: "${{ secrets.RUNNER_GOTIFY_URL }}"
gotify_app_token: '${{ secrets.RIKKU_RUNNER_GOTIFY_TOKEN }}' gotify_app_token: "${{ secrets.RUNNER_GOTIFY_TOKEN }}"
notification_title: 'GITEA: Docker Compose Dry Run @ Rikku' notification_title: "GITEA: Docker Compose Dry Run @ Rikku"
notification_message: 'Docker Compose dry run completed successfully.' notification_message: "Docker Compose dry run completed successfully."
regenerate-readme-modified-services: regenerate-readme-modified-services:
name: Update README & Generate List of Modified Services name: Update README & Generate List of Modified Services
@@ -219,10 +219,10 @@ jobs:
- name: Gotify Notification - name: Gotify Notification
uses: eikendev/gotify-action@master uses: eikendev/gotify-action@master
with: with:
gotify_api_base: '${{ secrets.RIKKU_GOTIFY_URL }}' gotify_api_base: "${{ secrets.RUNNER_GOTIFY_URL }}"
gotify_app_token: '${{ secrets.RIKKU_RUNNER_GOTIFY_TOKEN }}' gotify_app_token: "${{ secrets.RUNNER_GOTIFY_TOKEN }}"
notification_title: 'GITEA: README Update' notification_title: "GITEA: README Update"
notification_message: 'Updating README...' notification_message: "Updating README..."
- name: Generate service list - name: Generate service list
run: | run: |
@@ -250,14 +250,19 @@ jobs:
- name: Gotify Notification - name: Gotify Notification
uses: eikendev/gotify-action@master uses: eikendev/gotify-action@master
with: with:
gotify_api_base: '${{ secrets.RIKKU_GOTIFY_URL }}' gotify_api_base: "${{ secrets.RUNNER_GOTIFY_URL }}"
gotify_app_token: '${{ secrets.RIKKU_RUNNER_GOTIFY_TOKEN }}' gotify_app_token: "${{ secrets.RUNNER_GOTIFY_TOKEN }}"
notification_title: 'GITEA: README Update' notification_title: "GITEA: README Update"
notification_message: 'README updated' notification_message: "README updated"
pr-merge: pr-merge:
name: PR Merge name: PR Merge
needs: [generate-service-list, docker-compose-dry-run, regenerate-readme-modified-services] needs:
[
generate-service-list,
docker-compose-dry-run,
regenerate-readme-modified-services,
]
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
@@ -280,7 +285,7 @@ jobs:
- name: PR Merge - name: PR Merge
id: pr_merge id: pr_merge
run: | run: |
tea login add --name gitea-rinoa --url ${{ secrets.RIKKU_GITEA_URL }} --user gitea-sonarqube-bot --password "${{ secrets.BOT_GITEA_PASSWORD }}" --token ${{ secrets.BOT_GITEA_TOKEN }} tea login add --name gitea-rinoa --url ${{ secrets.TREZ_GITEA_URL }} --user gitea-sonarqube-bot --password "${{ secrets.BOT_GITEA_PASSWORD }}" --token ${{ secrets.BOT_GITEA_TOKEN }}
tea login default gitea-rinoa tea login default gitea-rinoa
echo "Merging PR..." echo "Merging PR..."
pr_index=$(tea pr ls --repo ${{ github.repository }} --state open --fields index,title,head,state --output csv | egrep ${{ github.ref_name }} | awk -F"," '{print $1}' | sed -e 's|"||g') pr_index=$(tea pr ls --repo ${{ github.repository }} --state open --fields index,title,head,state --output csv | egrep ${{ github.ref_name }} | awk -F"," '{print $1}' | sed -e 's|"||g')
@@ -290,17 +295,17 @@ jobs:
- name: Gotify Notification - name: Gotify Notification
uses: eikendev/gotify-action@master uses: eikendev/gotify-action@master
with: with:
gotify_api_base: '${{ secrets.RIKKU_GOTIFY_URL }}' gotify_api_base: "${{ secrets.RUNNER_GOTIFY_URL }}"
gotify_app_token: '${{ secrets.RIKKU_RUNNER_GOTIFY_TOKEN }}' gotify_app_token: "${{ secrets.RUNNER_GOTIFY_TOKEN }}"
notification_title: 'GITEA: PR Merge Successful' notification_title: "GITEA: PR Merge Successful"
notification_message: 'PR #${{ steps.pr_merge.outputs.pr_index }} merged.' notification_message: "PR #${{ steps.pr_merge.outputs.pr_index }} merged."
docker-compose-deploy: docker-compose-deploy:
name: Docker Compose Deployment name: Docker Compose Deployment
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [pr-merge] needs: [pr-merge]
env: env:
VAULT_ADDR: ${{ secrets.RIKKU_VAULT_ADDR }} VAULT_ADDR: ${{ secrets.TREZ_VAULT_ADDR }}
VAULT_TOKEN: ${{ secrets.VAULT_GITEA_TOKEN }} VAULT_TOKEN: ${{ secrets.VAULT_GITEA_TOKEN }}
RIKKU_REGISTRY_PASSWORD: ${{ secrets.BOT_GITEA_PASSWORD }} RIKKU_REGISTRY_PASSWORD: ${{ secrets.BOT_GITEA_PASSWORD }}
DOCKER_SVC_LIST: ${{ needs.generate-service-list.outputs.svc_deploy_list }} DOCKER_SVC_LIST: ${{ needs.generate-service-list.outputs.svc_deploy_list }}
@@ -330,28 +335,28 @@ jobs:
- name: Gotify Notification - name: Gotify Notification
uses: eikendev/gotify-action@master uses: eikendev/gotify-action@master
with: with:
gotify_api_base: '${{ secrets.RIKKU_GOTIFY_URL }}' gotify_api_base: "${{ secrets.RUNNER_GOTIFY_URL }}"
gotify_app_token: '${{ secrets.RIKKU_RUNNER_GOTIFY_TOKEN }}' gotify_app_token: "${{ secrets.RUNNER_GOTIFY_TOKEN }}"
notification_title: 'GITEA: Docker Compose Deployment @ Rikku' notification_title: "GITEA: Docker Compose Deployment @ Rikku"
notification_message: 'Starting Docker Compose run...' notification_message: "Starting Docker Compose run..."
- name: Generate .env file for deployment - name: Generate .env file for deployment
run: | run: |
vault kv get -format=json rikku-docker/env | jq -r '.data.data' | jq -r 'keys[] as $k | "\($k)='\''\(.[$k])'\''"' > .env vault kv get -format=json rikku-docker/env | jq -r '.data.data' | jq -r 'keys[] as $k | "\($k)='\''\(.[$k])'\''"' > .env
echo ${DOCKER_SVC_LIST} echo ${DOCKER_SVC_LIST}
- name: Docker Compose Deployment - name: Docker Compose Deployment
uses: cssnr/stack-deploy-action@d58b92bcd776afc57ef12f55bafff71200fd218e # v1.4.0 uses: cssnr/stack-deploy-action@d58b92bcd776afc57ef12f55bafff71200fd218e # v1.4.0
with: with:
mode: compose mode: compose
file: docker-compose.yml file: docker-compose.yml
name: 'rikku' name: "rikku"
host: 192.168.1.252 host: 192.168.1.252
user: pi user: pi
ssh_key: ${{ secrets.RIKKU_SSH_PRIVATE_KEY }} ssh_key: ${{ secrets.RUNNER_SSH_PRIVATE_KEY }}
args: --remove-orphans -d ${{ needs.generate-service-list.outputs.svc_deploy_list }} args: --remove-orphans -d ${{ needs.generate-service-list.outputs.svc_deploy_list }}
env_file: '.env' env_file: ".env"
registry_host: 'ghcr.io' registry_host: "ghcr.io"
registry_user: TrezOne registry_user: TrezOne
registry_pass: ${{ secrets.GHCR_LOGIN_TOKEN }} registry_pass: ${{ secrets.GHCR_LOGIN_TOKEN }}
summary: true summary: true
@@ -370,7 +375,7 @@ jobs:
- name: Gotify Notification - name: Gotify Notification
uses: eikendev/gotify-action@master uses: eikendev/gotify-action@master
with: with:
gotify_api_base: '${{ secrets.RIKKU_GOTIFY_URL }}' gotify_api_base: "${{ secrets.RUNNER_GOTIFY_URL }}"
gotify_app_token: '${{ secrets.RIKKU_RUNNER_GOTIFY_TOKEN }}' gotify_app_token: "${{ secrets.RUNNER_GOTIFY_TOKEN }}"
notification_title: 'GITEA: Docker Compose Deployment @ Rikku' notification_title: "GITEA: Docker Compose Deployment @ Rikku"
notification_message: 'Deployment completed successfully.' notification_message: "Deployment completed successfully."
+6 -6
View File
@@ -10,7 +10,7 @@ on:
- "**/docker-compose.yml" - "**/docker-compose.yml"
env: env:
VAULT_ADDR: ${{ secrets.RIKKU_VAULT_ADDR }} VAULT_ADDR: ${{ secrets.TREZ_VAULT_ADDR }}
VAULT_TOKEN: ${{ secrets.VAULT_GITEA_TOKEN }} VAULT_TOKEN: ${{ secrets.VAULT_GITEA_TOKEN }}
HC_VAULT_VERSION: "1.18.0" HC_VAULT_VERSION: "1.18.0"
@@ -93,8 +93,8 @@ jobs:
- name: Gotify Notification - name: Gotify Notification
uses: eikendev/gotify-action@master uses: eikendev/gotify-action@master
with: with:
gotify_api_base: "${{ secrets.RIKKU_GOTIFY_URL }}" gotify_api_base: "${{ secrets.RUNNER_GOTIFY_URL }}"
gotify_app_token: "${{ secrets.RIKKU_RUNNER_GOTIFY_TOKEN }}" gotify_app_token: "${{ secrets.RUNNER_GOTIFY_TOKEN }}"
notification_title: "GITEA: [RENOVATE] Docker Compose Deployment @ Rikku" notification_title: "GITEA: [RENOVATE] Docker Compose Deployment @ Rikku"
notification_message: "Starting Docker Compose run..." notification_message: "Starting Docker Compose run..."
@@ -106,7 +106,7 @@ jobs:
name: "rikku" name: "rikku"
host: 192.168.1.252 host: 192.168.1.252
user: pi user: pi
ssh_key: ${{ secrets.RIKKU_SSH_PRIVATE_KEY }} ssh_key: ${{ secrets.RUNNER_SSH_PRIVATE_KEY }}
args: --remove-orphans -d ${{ needs.generate-service-list.outputs.svc_deploy_list }} args: --remove-orphans -d ${{ needs.generate-service-list.outputs.svc_deploy_list }}
env_file: ".env" env_file: ".env"
registry_host: "ghcr.io" registry_host: "ghcr.io"
@@ -128,7 +128,7 @@ jobs:
- name: Gotify Notification - name: Gotify Notification
uses: eikendev/gotify-action@master uses: eikendev/gotify-action@master
with: with:
gotify_api_base: "${{ secrets.RIKKU_GOTIFY_URL }}" gotify_api_base: "${{ secrets.RUNNER_GOTIFY_URL }}"
gotify_app_token: "${{ secrets.RIKKU_RUNNER_GOTIFY_TOKEN }}" gotify_app_token: "${{ secrets.RUNNER_GOTIFY_TOKEN }}"
notification_title: "GITEA: [RENOVATE] Docker Compose Deployment @ Rikku" notification_title: "GITEA: [RENOVATE] Docker Compose Deployment @ Rikku"
notification_message: "Deployment completed successfully." notification_message: "Deployment completed successfully."