|
27 | 27 | - name: Build docs |
28 | 28 | run: | |
29 | 29 | make docs-build |
30 | | - # push to netlify ------------------------------------------------------- |
31 | | - # set release name ---- |
32 | | - |
33 | | - - name: Configure pull release name |
34 | | - if: ${{github.event_name == 'pull_request'}} |
35 | | - run: | |
36 | | - echo "RELEASE_NAME=pr-${PR_NUMBER}" >> $GITHUB_ENV |
37 | | - env: |
38 | | - PR_NUMBER: ${{ github.event.number }} |
39 | | - - name: Configure branch release name |
40 | | - if: ${{github.event_name != 'pull_request'}} |
41 | | - run: | |
42 | | - # use branch name, but replace slashes. E.g. feat/a -> feat-a |
43 | | - echo "RELEASE_NAME=${GITHUB_REF_NAME/\//-}" >> $GITHUB_ENV |
44 | | - # deploy ---- |
45 | 30 | - name: Create Github Deployment |
46 | 31 | uses: bobheadxi/deployments@v1 |
47 | 32 | id: deployment |
|
54 | 39 | transient: true |
55 | 40 | logs: "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" |
56 | 41 |
|
57 | | - - name: Netlify docs preview |
58 | | - if: ${{ !github.event.pull_request.head.repo.fork }} |
59 | | - run: | |
60 | | - npm install -g netlify-cli |
61 | | - # push main branch to production, others to preview -- |
62 | | - netlify link --name="pointblank" |
63 | | - if [ "${ALIAS}" == "main" ]; then |
64 | | - netlify deploy --dir=docs/_site --alias="main" |
65 | | - else |
66 | | - netlify deploy --dir=docs/_site --alias="${ALIAS}" |
67 | | - fi |
68 | | - env: |
69 | | - NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} |
70 | | - NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} |
71 | | - ALIAS: ${{ steps.deployment.outputs.env }} |
72 | | - |
73 | 42 | - name: Update Github Deployment |
74 | 43 | uses: bobheadxi/deployments@v1 |
75 | 44 | if: ${{ !github.event.pull_request.head.repo.fork && always() }} |
|
0 commit comments