fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1name: Deploy 2 3on: 4 push: 5 branches: 6 - master 7 - beta 8 tags: 9 - rust-1.** 10 11env: 12 TARGET_BRANCH: 'gh-pages' 13 SHA: '${{ github.sha }}' 14 SSH_REPO: 'git@github.com:${{ github.repository }}.git' 15 16jobs: 17 deploy: 18 runs-on: ubuntu-latest 19 if: github.repository == 'rust-lang/rust-clippy' 20 21 steps: 22 # Setup 23 - name: Checkout 24 uses: actions/checkout@v3 25 26 - name: Checkout 27 uses: actions/checkout@v3 28 with: 29 ref: ${{ env.TARGET_BRANCH }} 30 path: 'out' 31 32 # Run 33 - name: Set tag name 34 if: startswith(github.ref, 'refs/tags/') 35 run: | 36 TAG=$(basename ${{ github.ref }}) 37 echo "TAG_NAME=$TAG" >> $GITHUB_ENV 38 - name: Set beta to true 39 if: github.ref == 'refs/heads/beta' 40 run: echo "BETA=true" >> $GITHUB_ENV 41 42 # We need to check out all files that (transitively) depend on the 43 # structure of the gh-pages branch, so that we're able to change that 44 # structure without breaking the deployment. 45 - name: Use deploy files from master branch 46 run: | 47 git fetch --no-tags --prune --depth=1 origin master 48 git checkout origin/master -- .github/deploy.sh util/versions.py util/gh-pages/versions.html 49 50 # Generate lockfile for caching to avoid build problems with cached deps 51 - name: cargo generate-lockfile 52 run: cargo generate-lockfile 53 54 - name: Cache 55 uses: Swatinem/rust-cache@v1.3.0 56 57 - name: cargo collect-metadata 58 run: cargo collect-metadata 59 60 - name: Deploy 61 run: | 62 eval "$(ssh-agent -s)" 63 ssh-add - <<< "${{ secrets.DEPLOY_KEY }}" 64 bash .github/deploy.sh