Remove WIP text #8
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 and Deploy | |
| on: | |
| push: | |
| branches: ["main", "develop"] | |
| pull_request: | |
| branches: ["main"] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: "21" | |
| distribution: "temurin" | |
| - name: Install Leiningen | |
| run: | | |
| wget https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein | |
| chmod +x lein | |
| sudo mv lein /usr/local/bin/ | |
| - name: Install dependencies | |
| run: lein deps | |
| - name: Run tests | |
| run: lein test | |
| env: | |
| PORT: 3000 | |
| STRAVA_DOMAIN: https://www.strava.com | |
| STRAVA_API_URL: /api/v3 | |
| STRAVA_CODE: code | |
| STRAVA_CLIENT_ID: ${{ secrets.STRAVA_CLIENT_ID }} | |
| STRAVA_CLIENT_SECRET: ${{ secrets.STRAVA_CLIENT_SECRET }} | |
| STRAVA_REFRESH_TOKEN: ${{ secrets.STRAVA_REFRESH_TOKEN }} | |
| STRAVA_USER_ID: ${{ secrets.STRAVA_USER_ID }} | |
| deploy: | |
| name: Deploy via SSH | |
| runs-on: ubuntu-latest | |
| needs: test | |
| if: github.ref == 'refs/heads/main' && github.event_name == 'push' | |
| steps: | |
| - name: Run deployment script on remote server | |
| uses: appleboy/ssh-action@v1.2.4 | |
| with: | |
| host: ${{ secrets.HOST }} | |
| username: ${{ secrets.USERNAME }} | |
| key: ${{ secrets.SSH_PRIVATE_KEY }} | |
| port: ${{ secrets.PORT || 22 }} | |
| script: | | |
| cd /root/projects/strava-api-wrapper-clojure | |
| git pull origin main | |
| docker compose up -d --force-recreate |