diff --git a/.github/workflows/build-test-deploy.yaml b/.github/workflows/build-test-deploy.yaml index 7aabd5bd3..a612ce6a4 100644 --- a/.github/workflows/build-test-deploy.yaml +++ b/.github/workflows/build-test-deploy.yaml @@ -519,3 +519,8 @@ jobs: run: sudo apt-get install gitstats - name: Run run: ./.travis/build-gitstats.sh + - name: Deploy + if: github.ref == 'refs/heads/master' + env: + access_key: ${{ secrets.GITSTATS_DEPLOY_KEY }} + run: ./.travis/deploy-gitstats.sh diff --git a/.travis/deploy-gitstats.sh b/.travis/deploy-gitstats.sh index f9da3d8d9..3e40bf251 100755 --- a/.travis/deploy-gitstats.sh +++ b/.travis/deploy-gitstats.sh @@ -26,4 +26,7 @@ git add . git commit --quiet -m "Deploy to GH pages from commit: $COMMIT" echo "Pushing to GH pages..." -git push --force --quiet "https://${GH_TOKEN_GITSTATS}@github.com/qTox/gitstats.git" master:gh-pages &> /dev/null +touch /tmp/access_key +chmod 600 /tmp/access_key +echo "$access_key" > /tmp/access_key +GIT_SSH_COMMAND="ssh -i /tmp/access_key" git push --force --quiet "git@github.com/qTox/gitstats.git" master:gh-pages