diff --git a/.github/workflows/build_and_deploy.yaml b/.github/workflows/build_and_deploy.yaml index 4903bf0..98ed682 100644 --- a/.github/workflows/build_and_deploy.yaml +++ b/.github/workflows/build_and_deploy.yaml @@ -25,15 +25,24 @@ 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 + dry-run: ${{ env.DRY_RUN }} + 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'