ci: bump ruby/setup-ruby from 1.157.0 to 1.159.0 #312
Workflow file for this run
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: build-website | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
jekyll: | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
branch: [slicer-org, download-slicer-org, download-maintenance-slicer-org, deploy-download-preview, deploy-download-maintenance-preview] | |
include: | |
- branch: download-slicer-org | |
custom_opts: '--config _config.yml,_config_download.yml' | |
- branch: download-maintenance-slicer-org | |
custom_opts: '--config _config.yml,_config_download.yml,_config_download_maintenance.yml' | |
- branch: deploy-download-preview | |
custom_opts: '--config _config.yml,_config_download.yml,_config_netlify_deploy_download_preview.yml' | |
- branch: deploy-download-maintenance-preview | |
custom_opts: '--config _config.yml,_config_download.yml,_config_download_maintenance.yml,_config_netlify_deploy_download_maintenance_preview.yml' | |
env: | |
deploy_download_preview: ${{ matrix.branch == 'deploy-download-preview' && github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' }} | |
deploy_download_maintenance_preview: ${{ matrix.branch == 'deploy-download-maintenance-preview' && github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' }} | |
steps: | |
# See https://github.com/thollander/actions-comment-pull-request | |
- name: Add or update Pull Request comment including screenshot [deploy_download_preview] | |
if: env.deploy_download_preview == 'true' | |
uses: thollander/actions-comment-pull-request@1d3973dc4b8e1399c0620d3f2b1aa5e795465308 # v2.4.3 | |
env: | |
MESSAGE: | | |
### download.slicer.org preview [branch: deploy_download_preview] | |
:hourglass: **IN PROGRESS** | |
with: | |
message: ${{ env.MESSAGE }} | |
comment_tag: deploy_download_preview | |
GITHUB_TOKEN: ${{ secrets.SLICERBOT_GITHUB_TOKEN }} | |
# See https://github.com/thollander/actions-comment-pull-request | |
- name: Add or update Pull Request comment including screenshot [deploy_download_maintenance_preview] | |
if: env.deploy_download_maintenance_preview == 'true' | |
uses: thollander/actions-comment-pull-request@1d3973dc4b8e1399c0620d3f2b1aa5e795465308 # v2.4.3 | |
env: | |
MESSAGE: | | |
### download.slicer.org preview [branch: deploy_download_maintenance_preview] | |
:hourglass: **IN PROGRESS** | |
with: | |
message: ${{ env.MESSAGE }} | |
comment_tag: deploy_download_maintenance_preview | |
GITHUB_TOKEN: ${{ secrets.SLICERBOT_GITHUB_TOKEN }} | |
- name: 📂 setup | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- name: 💎 setup ruby | |
uses: ruby/setup-ruby@54a18e26dbbb1eabc604f317ade9a5788dddef81 # v1.159.0 | |
with: | |
ruby-version: 2.7 # can change this to 2.7 or whatever version you prefer | |
# See https://github.com/ouzi-dev/commit-status-updater | |
- name: Update status check for deploy-download-preview to pending | |
if: env.deploy_download_preview == 'true' | |
uses: ouzi-dev/commit-status-updater@219d3f932547cad092e384c7a36bf4d963739c35 # v2.0.1 | |
with: | |
name: 'netlify/deploy-download-preview' | |
status: 'pending' | |
url: https://app.netlify.com/sites/slicer-org/deploys?filter=deploy-download-preview | |
description: 'Deploy Preview processing.' | |
# See https://github.com/ouzi-dev/commit-status-updater | |
- name: Update status check for deploy-download-maintenance-preview to pending | |
if: env.deploy_download_maintenance_preview == 'true' | |
uses: ouzi-dev/commit-status-updater@219d3f932547cad092e384c7a36bf4d963739c35 # v2.0.1 | |
with: | |
name: 'netlify/deploy-download-maintenance-preview' | |
status: 'pending' | |
url: https://app.netlify.com/sites/slicer-org/deploys?filter=deploy-download-maintenance-preview | |
description: 'Download Maintenance processing.' | |
# See https://github.com/marketplace/actions/jekyll-action-ts | |
- name: 🔨 install dependencies & build site | |
uses: limjh16/jekyll-action-ts@c5e4c83672987df379d6924ca6dfa8891ac1c067 # v2 | |
with: | |
enable_cache: true | |
custom_opts: ${{ matrix.custom_opts }} | |
- name: 'Evaluate download template [release_and_nightly]' | |
if: env.deploy_download_preview == 'true' | |
uses: cuchi/jinja2-action@3fa06acb38601d3caea4c5ce0416e268a8799d71 # v1.2.1 | |
with: | |
template: _site/download.html | |
data_file: _data/template_test_data/download_release_and_nightly.json | |
output_file: _site/download_release_and_nightly.html | |
- name: 'Evaluate download template [only_release]' | |
if: env.deploy_download_preview == 'true' | |
uses: cuchi/jinja2-action@3fa06acb38601d3caea4c5ce0416e268a8799d71 # v1.2.1 | |
with: | |
template: _site/download.html | |
data_file: _data/template_test_data/download_only_release.json | |
output_file: _site/download_only_release.html | |
- name: 'Evaluate download template [only_nightly]' | |
if: env.deploy_download_preview == 'true' | |
uses: cuchi/jinja2-action@3fa06acb38601d3caea4c5ce0416e268a8799d71 # v1.2.1 | |
with: | |
template: _site/download.html | |
data_file: _data/template_test_data/download_only_nightly.json | |
output_file: _site/download_only_nightly.html | |
- name: 'Evaluate download template [incomplete_releases]' | |
if: env.deploy_download_preview == 'true' | |
uses: cuchi/jinja2-action@3fa06acb38601d3caea4c5ce0416e268a8799d71 # v1.2.1 | |
with: | |
template: _site/download.html | |
data_file: _data/template_test_data/download_incomplete_releases.json | |
output_file: _site/download_incomplete_releases.html | |
- name: 'Upload website build' | |
if: matrix.branch != 'deploy-download-preview' | |
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 | |
with: | |
name: ${{ matrix.branch }}-website-build | |
path: ./_site | |
retention-days: 1 | |
# See https://github.com/marketplace/actions/github-pages-action | |
- name: 🚀 deploy | |
if: | | |
github.ref == 'refs/heads/main' || env.deploy_download_preview == 'true' || env.deploy_download_maintenance_preview == 'true' | |
uses: peaceiris/actions-gh-pages@373f7f263a76c20808c831209c920827a82a2847 # v3.9.3 | |
with: | |
force_orphan: true | |
github_token: ${{ secrets.SLICERBOT_GITHUB_TOKEN }} | |
publish_dir: ./_site | |
publish_branch: ${{ matrix.branch }} | |
user_name: 'Slicer Bot' | |
user_email: '[email protected]' | |
# See https://github.com/ouzi-dev/commit-status-updater | |
- name: Update status check for deploy-download-preview | |
if: env.deploy_download_preview == 'true' | |
uses: ouzi-dev/commit-status-updater@219d3f932547cad092e384c7a36bf4d963739c35 # v2.0.1 | |
with: | |
name: 'netlify/deploy-download-preview' | |
status: 'success' | |
url: https://deploy-download-preview--slicer-org.netlify.app/download.html | |
description: 'Deploy Preview ready!' | |
# See https://github.com/ouzi-dev/commit-status-updater | |
- name: Update status check for deploy-download-maintenance-preview | |
if: env.deploy_download_maintenance_preview == 'true' | |
uses: ouzi-dev/commit-status-updater@219d3f932547cad092e384c7a36bf4d963739c35 # v2.0.1 | |
with: | |
name: 'netlify/deploy-download-maintenance-preview' | |
status: 'success' | |
url: https://deploy-download-maintenance-preview--slicer-org.netlify.app/download.html | |
description: 'Deploy Maintenance Preview ready!' | |
- name: Wait for Netlify to deploy 'deploy-download-preview' or 'deploy-download-maintenance-preview' branch | |
if: env.deploy_download_preview == 'true' || env.deploy_download_maintenance_preview == 'true' | |
run: sleep 30s | |
shell: bash | |
- name: Capture deploy-download-preview screenshot [release_and_nightly] | |
if: env.deploy_download_preview == 'true' | |
uses: ./.github/actions/screenshot-website-imgur-upload | |
id: capture_deploy_download_preview_release_and_nightly | |
with: | |
source_url: https://deploy-download-preview--slicer-org.netlify.app/download_release_and_nightly.html | |
imgur_client_id: ${{secrets.SLICER_IMGUR_CLIENT_ID}} | |
- name: Capture deploy-download-preview screenshot [only_release] | |
if: env.deploy_download_preview == 'true' | |
uses: ./.github/actions/screenshot-website-imgur-upload | |
id: capture_deploy_download_preview_only_release | |
with: | |
source_url: https://deploy-download-preview--slicer-org.netlify.app/download_only_release.html | |
imgur_client_id: ${{secrets.SLICER_IMGUR_CLIENT_ID}} | |
- name: Capture deploy-download-preview screenshot [only_nightly] | |
if: env.deploy_download_preview == 'true' | |
uses: ./.github/actions/screenshot-website-imgur-upload | |
id: capture_deploy_download_preview_only_nightly | |
with: | |
source_url: https://deploy-download-preview--slicer-org.netlify.app/download_only_nightly.html | |
imgur_client_id: ${{secrets.SLICER_IMGUR_CLIENT_ID}} | |
- name: Capture deploy-download-preview screenshot [incomplete_releases] | |
if: env.deploy_download_preview == 'true' | |
uses: ./.github/actions/screenshot-website-imgur-upload | |
id: capture_deploy_download_preview_incomplete_releases | |
with: | |
source_url: https://deploy-download-preview--slicer-org.netlify.app/download_incomplete_releases.html | |
imgur_client_id: ${{secrets.SLICER_IMGUR_CLIENT_ID}} | |
# See https://github.com/thollander/actions-comment-pull-request | |
- name: Add or update Pull Request comment including screenshot [deploy_download_preview] | |
if: env.deploy_download_preview == 'true' | |
uses: thollander/actions-comment-pull-request@1d3973dc4b8e1399c0620d3f2b1aa5e795465308 # v2.4.3 | |
env: | |
IMG_URL_0: ${{ steps.capture_deploy_download_preview_release_and_nightly.outputs.imgur_url }} | |
IMG_URL_1: ${{ steps.capture_deploy_download_preview_only_release.outputs.imgur_url }} | |
IMG_URL_2: ${{ steps.capture_deploy_download_preview_only_nightly.outputs.imgur_url }} | |
IMG_URL_3: ${{ steps.capture_deploy_download_preview_incomplete_releases.outputs.imgur_url }} | |
MESSAGE: | | |
### download.slicer.org preview [branch: deploy_download_preview] | |
_:warning: The download preview is a static website generated using mock data [^1], is temporary and may be updated at anytime [^2]_ | |
| Screenshot from https://deploy-download-preview--slicer-org.netlify.app/download_release_and_nightly.html | Screenshot from https://deploy-download-preview--slicer-org.netlify.app/download_only_release.html | Screenshot from https://deploy-download-preview--slicer-org.netlify.app/download_only_nightly.html | | |
|--|--|--| | |
| ![Screenshot]({0}) | ![Screenshot]({1}) | ![Screenshot]({2}) | | |
| Screenshot from https://deploy-download-preview--slicer-org.netlify.app/download_release_and_nightly.html | | |
| ![Screenshot]({3}) | | | | |
[^1]: See [front matter](https://jekyllrb.com/docs/front-matter/) variable `download_mock` associated with https://raw.githubusercontent.com/Slicer/slicer.org/main/download.markdown | |
[^2]: Due to limitation of Netlify preventing us from having multiple [deploy previews](https://docs.netlify.com/site-deploys/deploy-previews/) associated with a single pull request and the [impossibility](https://github.community/t/make-secrets-available-to-builds-of-forks/16166) of using repository secret in a workflow associated with a pull-request originating from forks, the `deploy-download-preview` site is only updated for pull request originating from this repository and will be overriden after another pull request is pushed or updated. | |
with: | |
message: ${{ format(env.MESSAGE, env.IMG_URL_0, env.IMG_URL_1, env.IMG_URL_2, env.IMG_URL_3) }} | |
comment_tag: deploy_download_preview | |
GITHUB_TOKEN: ${{ secrets.SLICERBOT_GITHUB_TOKEN }} | |
- name: Capture deploy-download-maintenance-preview screenshot | |
if: env.deploy_download_maintenance_preview == 'true' | |
uses: ./.github/actions/screenshot-website-imgur-upload | |
id: capture_deploy_download_maintenance_preview | |
with: | |
source_url: https://deploy-download-maintenance-preview--slicer-org.netlify.app/download.html | |
imgur_client_id: ${{secrets.SLICER_IMGUR_CLIENT_ID}} | |
# See https://github.com/thollander/actions-comment-pull-request | |
- name: Add or update Pull Request comment including screenshot [deploy_download_maintenance_preview] | |
if: env.deploy_download_maintenance_preview == 'true' | |
uses: thollander/actions-comment-pull-request@1d3973dc4b8e1399c0620d3f2b1aa5e795465308 # v2.4.3 | |
env: | |
IMG_URL_0: ${{ steps.capture_deploy_download_maintenance_preview.outputs.imgur_url }} | |
MESSAGE: | | |
### download.slicer.org preview [branch: deploy_download_maintenance_preview] | |
_:warning: The download preview is a static website generated using mock data [^1], is temporary and may be updated at anytime [^2]_ | |
| Screenshot from https://deploy-download-maintenance-preview--slicer-org.netlify.app/download.html | | |
|--| | |
| ![Screenshot]({0}) | | |
[^1]: See [front matter](https://jekyllrb.com/docs/front-matter/) variable `download_mock` associated with https://raw.githubusercontent.com/Slicer/slicer.org/main/download.markdown | |
[^2]: Due to limitation of Netlify preventing us from having multiple [deploy previews](https://docs.netlify.com/site-deploys/deploy-previews/) associated with a single pull request and the [impossibility](https://github.community/t/make-secrets-available-to-builds-of-forks/16166) of using repository secret in a workflow associated with a pull-request originating from forks, the `deploy-download-preview` site is only updated for pull request originating from this repository and will be overriden after another pull request is pushed or updated. | |
with: | |
message: ${{ format(env.MESSAGE, env.IMG_URL_0) }} | |
comment_tag: deploy_download_maintenance_preview | |
GITHUB_TOKEN: ${{ secrets.SLICERBOT_GITHUB_TOKEN }} | |