diff --git a/.gitea/workflows/pr-docker-deploy.yml b/.gitea/workflows/pr-docker-deploy.yml index b95e90a..e181e21 100644 --- a/.gitea/workflows/pr-docker-deploy.yml +++ b/.gitea/workflows/pr-docker-deploy.yml @@ -145,10 +145,6 @@ jobs: - name: Checkout uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 - # - name: Login to Gitea Container Registry - # run: | - # docker login -u gitea-sonarqube-bot -p ${RIKKU_REGISTRY_PASSWORD} git.trez.wtf - - name: Login to Docker Hub uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0 with: @@ -169,19 +165,6 @@ jobs: username: ${{ secrets.BOT_GITEA_USER }} password: ${{ secrets.BOT_GITEA_PASSWORD }} - - name: Cache Vault install - id: cache-vault - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 - with: - path: /opt/hostedtoolcache/vault/${{ env.HC_VAULT_VERSION }}/x64 - key: vault-${{ runner.os }}-${{ env.HC_VAULT_VERSION }} - - - name: Install Vault (only if not cached) - if: steps.cache-vault.outputs.cache-hit != 'true' - uses: cpanato/vault-installer@main - with: - version: ${{ env.HC_VAULT_VERSION }} - - name: Gotify Notification uses: eikendev/gotify-action@master with: @@ -190,9 +173,19 @@ jobs: notification_title: "GITEA: Docker Compose Dry Run @ Rikku" notification_message: "Starting Docker Compose dry run..." - - name: Generate .env file for Docker Compose - run: | - vault kv get -format=json rikku-docker/env | jq -r '.data.data' | jq -r 'keys[] as $k | "\($k)='\''\(.[$k])'\''"' > .env + - name: Generate .env from Hashicorp Vault + uses: https://git.trez.wtf/Trez/hc-vault-env@main + with: + HC_VAULT_VERSION: ${{ env.HC_VAULT_VERSION }} + HC_VAULT_ADDR: ${{ secrets.TREZ_VAULT_ADDR }} + HC_VAULT_USERNAME: ${{ secrets.VAULT_GITEA_USER }} + HC_VAULT_PASSWORD: ${{ secrets.VAULT_GITEA_PASSWORD }} + HC_VAULT_SECRETS_PATH: rikku-docker/env + + - name: Pre-pull/build service images in parallel + uses: https://git.trez.wtf/Trez/docker-select-image-pull@main + with: + services: ${{ env.DOCKER_SVC_LIST }} - name: Docker Compose Dry Run uses: cssnr/stack-deploy-action@d58b92bcd776afc57ef12f55bafff71200fd218e # v1.4.0 @@ -328,23 +321,6 @@ jobs: with: ref: main - - name: Cache Vault install - id: cache-vault - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 - with: - path: /opt/hostedtoolcache/vault/${{ env.HC_VAULT_VERSION }}/x64 - key: vault-${{ runner.os }}-${{ env.HC_VAULT_VERSION }} - - - name: Install Vault (only if not cached) - if: steps.cache-vault.outputs.cache-hit != 'true' - uses: cpanato/vault-installer@main - with: - version: ${{ env.HC_VAULT_VERSION }} - - # - name: Login to Gitea Container Registry - # run: | - # docker login -u gitea-sonarqube-bot -p ${RIKKU_REGISTRY_PASSWORD} git.trez.wtf - - name: Login to Docker Hub uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0 with: @@ -373,10 +349,14 @@ jobs: notification_title: "GITEA: Docker Compose Deployment @ Rikku" notification_message: "Starting Docker Compose run..." - - name: Generate .env file for deployment - run: | - vault kv get -format=json rikku-docker/env | jq -r '.data.data' | jq -r 'keys[] as $k | "\($k)='\''\(.[$k])'\''"' > .env - echo ${DOCKER_SVC_LIST} + - name: Generate .env from Hashicorp Vault + uses: https://git.trez.wtf/Trez/hc-vault-env@main + with: + HC_VAULT_VERSION: ${{ env.HC_VAULT_VERSION }} + HC_VAULT_ADDR: ${{ secrets.TREZ_VAULT_ADDR }} + HC_VAULT_USERNAME: ${{ secrets.VAULT_GITEA_USER }} + HC_VAULT_PASSWORD: ${{ secrets.VAULT_GITEA_PASSWORD }} + HC_VAULT_SECRETS_PATH: rikku-docker/env - name: Docker Compose Deployment uses: cssnr/stack-deploy-action@d58b92bcd776afc57ef12f55bafff71200fd218e # v1.4.0