chore(update-stage.yml): modify env dir #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Local Deployment | |
on: | |
push: | |
branches: main | |
jobs: | |
deploy: | |
runs-on: self-hosted | |
steps: | |
- 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 | |
# 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 | |
EOF | |
- name: Run Docker Compose | |
run: | | |
cd ./grafana | |
docker-compose up -d |