37 lines
1.2 KiB
YAML
37 lines
1.2 KiB
YAML
name: List Infisical Secrets
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
list-secrets:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Force DNS resolution
|
|
run: |
|
|
# Install dnsutils to get the 'dig' command
|
|
sudo apt-get update && sudo apt-get install -y dnsutils
|
|
|
|
# Dynamically fetch the public IP to handle dynamic DNS
|
|
# We query Cloudflare DNS (1.1.1.1) to ignore local/Tailscale records
|
|
PUBLIC_IP=$(dig +short @1.1.1.1 infisical.lemarechal.eu | tail -n1)
|
|
echo "Public IP found: $PUBLIC_IP"
|
|
echo "$PUBLIC_IP infisical.lemarechal.eu" | sudo tee -a /etc/hosts
|
|
|
|
- name: Fetch Secrets from Infisical
|
|
uses: https://github.com/Infisical/secrets-action@v1.0.7
|
|
with:
|
|
client-id: ${{ secrets.INFISICAL_CLIENT_ID }}
|
|
client-secret: ${{ secrets.INFISICAL_CLIENT_SECRET }}
|
|
project-id: ${{ secrets.INFISICAL_PROJECT_ID }}
|
|
env-slug: prod
|
|
secret-path: /Discord_bot
|
|
domain: https://infisical.lemarechal.eu
|
|
|
|
- name: Display Secrets
|
|
run: |
|
|
echo "Secrets fetched and injected as environment variables."
|
|
env | grep -v "GITHUB_" | grep -v "GITEA_" | sort
|