Add SC24 tutorial to resources (#31) #65
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
concurrency: | |
# Skip intermediate builds: always. | |
# Cancel intermediate builds: always. | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
options: | |
name: "Set options" | |
runs-on: ubuntu-latest | |
outputs: | |
deploy: ${{ steps.set-options.outputs.deploy }} | |
preview: ${{ steps.set-options.outputs.preview }} | |
steps: | |
- name: Set options | |
id: set-options | |
run: | | |
# By default always deploy | |
DEPLOY="true" | |
# Create previews only for pull requests | |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then | |
PREVIEW="previews/PR${PRNUM}" | |
# For pull requests, actually deploy only if the PR was opened on the same | |
# repository. | |
if [[ "${{ github.repository }}" != "${{ github.event.pull_request.head.repo.full_name }}" ]]; then | |
DEPLOY="false" | |
fi | |
else | |
PREVIEW="" | |
fi | |
echo "deploy=${DEPLOY}" | |
echo "deploy=${DEPLOY}" >> "${GITHUB_OUTPUT}" | |
echo "preview=${PREVIEW}" | |
echo "preview=${PREVIEW}" >> "${GITHUB_OUTPUT}" | |
env: | |
PRNUM: ${{ github.event.number }} | |
deploy: | |
name: "Build and Deploy" | |
needs: options | |
runs-on: ubuntu-latest | |
permissions: write-all | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: julia-actions/cache@v2 | |
- uses: tlienart/[email protected] | |
with: | |
# NOTE: this is the base URL prefix (landing page at /$BASE_URL_PREFIX/) | |
BASE_URL_PREFIX: "" | |
# Whether to deploy the website or not. Can do only for PRs opened | |
# from the same repository. | |
DEPLOY: ${{ needs.options.outputs.deploy }} | |
# Directory where to deploy the website. | |
PREVIEW: ${{ needs.options.outputs.preview }} |