Skip to content

Commit

Permalink
Upload the branch version of the website for pull requests
Browse files Browse the repository at this point in the history
Also change the main upload action to only execute when the action is
not triggered by a PR.
  • Loading branch information
JeremyMcCormick committed May 17, 2024
1 parent b467cd4 commit 7a25b17
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/build_and_deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,23 @@ jobs:
- name: Build the website
run: ./hugo

- name: Set dry run
run: echo "DRY_RUN=${{ github.event_name == 'pull_request' && 'true' || 'false' }}" >> $GITHUB_ENV
- name: Upload the branch version of the website
uses: Dylan700/sftp-upload-action@latest
with:
username: webstage
server: web.ivoa.net
key: ${{ secrets.STAGE_ID }}
uploads: |
./public/ => ./ivoa-web-stage/v/${{ github.ref_name }}
delete: 'true'
if: github.event_name == 'pull_request'

- name: Deploy the website
uses: Dylan700/sftp-upload-action@latest
with:
username: webstage
server: web.ivoa.net
dry-run: ${{ env.DRY_RUN }}
key: ${{ secrets.STAGE_ID }}
uploads: |
./public/ => ./ivoa-web-stage/
if: github.event_name != 'pull_request'

0 comments on commit 7a25b17

Please sign in to comment.