Deploy Grafana to Development #1
This file contains hidden or 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: Deploy Grafana to Development | |
| on: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| packages: write | |
| jobs: | |
| deploy: | |
| name: Deploy to Production Server | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: SSH proxy command | |
| uses: appleboy/ssh-action@v1 | |
| with: | |
| host: ${{ secrets.API_HOST }} | |
| username: root | |
| key: ${{ secrets.SSH_PRIVATE_KEY }} | |
| # password: ${{ secrets.API_PASSWORD}} | |
| script: | | |
| cd /root/core/infra | |
| git fetch | |
| git checkout dev | |
| git reset --hard origin/dev | |
| git pull | |
| export INFISICAL_TOKEN=$(infisical login \ | |
| --method=universal-auth \ | |
| --client-id='${{ secrets.INFISICAL_CLIENT_ID }}' \ | |
| --client-secret='${{ secrets.INFISICAL_CLIENT_SECRET }}' \ | |
| --silent \ | |
| --plain) | |
| infisical export \ | |
| --token=$INFISICAL_TOKEN \ | |
| --env=dev \ | |
| --format=dotenv \ | |
| --path="/api" \ | |
| --projectId='${{ secrets.INFISICAL_PROJECT_ID }}' \ | |
| > ./secrets/.env.dev.api | |
| docker compose -f docker-compose.api.yml pull alloy loki grafana-dev | |
| docker compose -f docker-compose.api.yml up -d --no-deps --force-recreate alloy loki grafana-dev |