2020-01-22 14:00:31 -06:00
|
|
|
name: Deploy
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2020-02-12 04:02:07 -06:00
|
|
|
branches:
|
|
|
|
- master
|
2020-03-25 14:01:11 -05:00
|
|
|
- beta
|
2020-02-12 07:49:08 -06:00
|
|
|
tags:
|
|
|
|
- rust-1.**
|
2020-01-22 14:00:31 -06:00
|
|
|
|
|
|
|
env:
|
|
|
|
TARGET_BRANCH: 'gh-pages'
|
|
|
|
SHA: '${{ github.sha }}'
|
|
|
|
SSH_REPO: 'git@github.com:${{ github.repository }}.git'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
deploy:
|
|
|
|
runs-on: ubuntu-latest
|
2020-02-23 22:38:35 -06:00
|
|
|
if: github.repository == 'rust-lang/rust-clippy'
|
2020-01-22 14:00:31 -06:00
|
|
|
|
|
|
|
steps:
|
2020-02-07 15:24:41 -06:00
|
|
|
# Setup
|
2020-01-22 14:00:31 -06:00
|
|
|
- name: Checkout
|
2023-12-26 17:43:16 -06:00
|
|
|
uses: actions/checkout@v4
|
2020-02-07 15:24:41 -06:00
|
|
|
|
2020-01-22 14:00:31 -06:00
|
|
|
- name: Checkout
|
2023-12-26 17:43:16 -06:00
|
|
|
uses: actions/checkout@v4
|
2020-01-22 14:00:31 -06:00
|
|
|
with:
|
|
|
|
ref: ${{ env.TARGET_BRANCH }}
|
|
|
|
path: 'out'
|
2020-02-07 15:24:41 -06:00
|
|
|
|
|
|
|
# Run
|
2020-02-12 07:49:08 -06:00
|
|
|
- name: Set tag name
|
|
|
|
if: startswith(github.ref, 'refs/tags/')
|
|
|
|
run: |
|
|
|
|
TAG=$(basename ${{ github.ref }})
|
2020-10-09 03:40:04 -05:00
|
|
|
echo "TAG_NAME=$TAG" >> $GITHUB_ENV
|
2020-03-25 14:01:11 -05:00
|
|
|
- name: Set beta to true
|
|
|
|
if: github.ref == 'refs/heads/beta'
|
2020-10-09 03:40:04 -05:00
|
|
|
run: echo "BETA=true" >> $GITHUB_ENV
|
2020-04-23 13:44:18 -05:00
|
|
|
|
2021-05-31 10:46:20 -05:00
|
|
|
# We need to check out all files that (transitively) depend on the
|
|
|
|
# structure of the gh-pages branch, so that we're able to change that
|
|
|
|
# structure without breaking the deployment.
|
|
|
|
- name: Use deploy files from master branch
|
2020-04-23 13:44:18 -05:00
|
|
|
run: |
|
|
|
|
git fetch --no-tags --prune --depth=1 origin master
|
2021-05-31 10:46:20 -05:00
|
|
|
git checkout origin/master -- .github/deploy.sh util/versions.py util/gh-pages/versions.html
|
|
|
|
|
|
|
|
# Generate lockfile for caching to avoid build problems with cached deps
|
|
|
|
- name: cargo generate-lockfile
|
|
|
|
run: cargo generate-lockfile
|
|
|
|
|
|
|
|
- name: Cache
|
2024-10-28 11:04:16 -05:00
|
|
|
uses: Swatinem/rust-cache@v2
|
2023-11-16 12:31:06 -06:00
|
|
|
with:
|
|
|
|
save-if: ${{ github.ref == 'refs/heads/master' }}
|
2021-05-31 10:46:20 -05:00
|
|
|
|
|
|
|
- name: cargo collect-metadata
|
|
|
|
run: cargo collect-metadata
|
2020-04-23 13:44:18 -05:00
|
|
|
|
2020-01-22 14:00:31 -06:00
|
|
|
- name: Deploy
|
|
|
|
run: |
|
|
|
|
eval "$(ssh-agent -s)"
|
|
|
|
ssh-add - <<< "${{ secrets.DEPLOY_KEY }}"
|
2020-01-26 08:40:53 -06:00
|
|
|
bash .github/deploy.sh
|