]> git.lizzy.rs Git - rust.git/blob - .github/workflows/deploy.yml
Auto merge of #7400 - popzxc:restrict-locales, r=Manishearth
[rust.git] / .github / workflows / deploy.yml
1 name: Deploy
2
3 on:
4   push:
5     branches:
6       - master
7       - beta
8     tags:
9       - rust-1.**
10
11 env:
12   TARGET_BRANCH: 'gh-pages'
13   SHA: '${{ github.sha }}'
14   SSH_REPO: 'git@github.com:${{ github.repository }}.git'
15
16 jobs:
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@v2.3.3
25
26     - name: Checkout
27       uses: actions/checkout@v2.3.3
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     - name: Use scripts and templates from master branch
43       run: |
44         git fetch --no-tags --prune --depth=1 origin master
45         git checkout origin/master -- .github/deploy.sh util/gh-pages/ util/*.py
46
47     - name: Deploy
48       run: |
49         eval "$(ssh-agent -s)"
50         ssh-add - <<< "${{ secrets.DEPLOY_KEY }}"
51         bash .github/deploy.sh