name: Deploy on: push: branches: - master tags: - rust-1.** env: TARGET_BRANCH: 'gh-pages' SHA: '${{ github.sha }}' SSH_REPO: 'git@github.com:${{ github.repository }}.git' jobs: deploy: runs-on: ubuntu-latest steps: # Setup - name: Checkout uses: actions/checkout@v2.0.0 - name: Checkout uses: actions/checkout@v2.0.0 with: ref: ${{ env.TARGET_BRANCH }} path: 'out' # Run - name: Set tag name if: startswith(github.ref, 'refs/tags/') run: | TAG=$(basename ${{ github.ref }}) echo "::set-env name=TAG_NAME::$TAG" - name: Deploy run: | eval "$(ssh-agent -s)" ssh-add - <<< "${{ secrets.DEPLOY_KEY }}" bash .github/deploy.sh