Skip to content

Commit

Permalink
add vault workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
francoriba committed Nov 2, 2024
1 parent 1266959 commit 2945531
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/VaultWorkflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Vault Workflow

on:
workflow_call:
outputs:
secrets_status:
description: "Status of secrets verification"
value: ${{ jobs.vault-secrets.outputs.verification_status }}

jobs:
vault-secrets:
runs-on: ubuntu-latest
outputs:
verification_status: ${{ steps.verify.outputs.status }}

steps:
- name: Debug Github Secrets # the 2 secrets needed for the vault action
run: |
echo "Checking secrets availability..."
if [ -n "${{ secrets.VAULT_ADDR }}" ]; then
echo "VAULT_ADDR is set"
else
echo "VAULT_ADDR is not set"
fi
if [ -n "${{ secrets.VAULT_TOKEN }}" ]; then
echo "VAULT_TOKEN is set"
else
echo "VAULT_TOKEN is not set"
fi
- name: Import Secrets from HCP Vault
uses: hashicorp/vault-action@v2
with:
url: ${{ secrets.VAULT_ADDR }}
method: token
token: ${{ secrets.VAULT_TOKEN }}
namespace: admin
secrets: |
kv/data/database DB_HOST ;
kv/data/database DB_USER ;
kv/data/database DB_PASSWORD ;
kv/data/database DB_NAME ;
kv/data/database DB_PORT ;
kv/data/jwt JWT_SECRET_KEY

0 comments on commit 2945531

Please sign in to comment.