add grafana to cloudflared #178
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: CI / CD | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| jobs: | |
| checks: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: git checkout | |
| uses: actions/checkout@v3 | |
| - name: Install Nix | |
| uses: DeterminateSystems/nix-installer-action@main | |
| - uses: DeterminateSystems/magic-nix-cache-action@main | |
| - name: Check Nixpkgs inputs | |
| uses: DeterminateSystems/flake-checker-action@main | |
| with: | |
| fail-mode: true | |
| - name: Nix fmt | |
| run: nix run nixpkgs#nixfmt -- -c **/*.nix | |
| - name: Flake check | |
| run: nix flake check | |
| # desactiver pour le moment, builds trop long en github actions | |
| deployment: | |
| needs: checks | |
| if: false # github.event_name == 'push' && github.ref_name == 'main' && needs.checks.result == 'success' # cf . https://www.w3tutorials.net/blog/conditional-needs-in-github-actions/ | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: git checkout | |
| uses: actions/checkout@v3 | |
| - name: Install Nix | |
| uses: DeterminateSystems/nix-installer-action@main | |
| - uses: DeterminateSystems/magic-nix-cache-action@main | |
| - name: Connect to | |
| uses: tailscale/github-action@v4 | |
| with: | |
| oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }} | |
| oauth-secret: ${{ secrets.TS_OAUTH_SECRET }} | |
| tags: tag:cd | |
| - name: Setup SSH | |
| uses: webfactory/ssh-agent@v0.9.0 | |
| with: | |
| ssh-private-key: ${{ secrets.KEY }} | |
| - name: Add hosts to known_hosts | |
| run: | | |
| mkdir -p ~/.ssh | |
| ssh-keyscan thinkcentre-1 thinkcentre-2 >> ~/.ssh/known_hosts | |
| - name: Deploy | |
| run: nix run github:serokell/deploy-rs . |