Skip to content

Commit

Permalink
�chore(update-stage.yml): modify to use .env file for handling secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
Dobby-Kim authored Jan 15, 2024
1 parent fa0a5cc commit 2190581
Showing 1 changed file with 5 additions and 24 deletions.
29 changes: 5 additions & 24 deletions .github/workflows/update-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,14 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Load Docker Compose Files
run: |
cp docker-compose.yml ./grafana
cp loki-config-stage.yml ./grafana
cp loki-config-test.yml ./grafana
- name: Set up Grafana Configuration
run: |
cat <<EOF > ./grafana/grafana.ini
# Non-sensitive configurations
[server]
protocol = http
http_port = 443
domain = grafana.codedang.com
enforce_domain = true
root_url = %(protocol)s://%(domain)s
serve_from_sub_path = true
cat <<EOF > ./grafana/.env
# Sensitive configurations from GitHub Secrets
[smtp]
enabled = true
host = ${{ secrets.SMTP_HOST }}
user = ${{ secrets.SMTP_USER }}
password = ${{ secrets.SMTP_PASSWORD }}
from_address = ${{ secrets.FROM_ADDRESS }}
from_name = Grafana
startTLS_policy = MandatoryStartTLS
GF_SMTP_HOST = ${{ secrets.SMTP_HOST }}
GF_SMTP_USER = ${{ secrets.SMTP_USER }}
GF_SMTP_PASSWORD = ${{ secrets.SMTP_PASSWORD }}
GF_SMTP_FROM_ADDRESS = ${{ secrets.FROM_ADDRESS }}
EOF
- name: Run Docker Compose
Expand Down

0 comments on commit 2190581

Please sign in to comment.