Skip to content

ci: bump ruby/setup-ruby from 1.179.0 to 1.179.1 #389

ci: bump ruby/setup-ruby from 1.179.0 to 1.179.1

ci: bump ruby/setup-ruby from 1.179.0 to 1.179.1 #389

Workflow file for this run

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@fabd468d3a1a0b97feee5f6b9e499eab0dd903f6 # v2.5.0
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@fabd468d3a1a0b97feee5f6b9e499eab0dd903f6 # v2.5.0
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@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- name: 💎 setup ruby
uses: ruby/setup-ruby@78c01b705fd9d5ad960d432d3a0cfa341d50e410 # v1.179.1
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@807a5f09755d777bfd3070e9505d02347844c9b2 # 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@6d31ec73a23fdd391e21e3efce8a91a87762980d # v1.2.2
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@6d31ec73a23fdd391e21e3efce8a91a87762980d # v1.2.2
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@6d31ec73a23fdd391e21e3efce8a91a87762980d # v1.2.2
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@6d31ec73a23fdd391e21e3efce8a91a87762980d # v1.2.2
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@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.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@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
with:
force_orphan: true
github_token: ${{ secrets.SLICERBOT_GITHUB_TOKEN }}
publish_dir: ./_site
publish_branch: ${{ matrix.branch }}
user_name: 'Slicer Bot'
user_email: 'slicerbot@users.noreply.github.com'
# 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@fabd468d3a1a0b97feee5f6b9e499eab0dd903f6 # v2.5.0
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@fabd468d3a1a0b97feee5f6b9e499eab0dd903f6 # v2.5.0
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 }}