Skip to content

RepoLink version B: site assets updated #49

RepoLink version B: site assets updated

RepoLink version B: site assets updated #49

#################################################################
#################################################################
## ##
## ##
## Andrea Grandieri andreagrandieri.github.io ##
## Version: B ##
## ##
## ##
#################################################################
#################################################################
# author: @AndreaGrandieri andreagrandieri.github.io
# inspired to: "Jekyll By GitHub Actions"
# If reusing this source, give credits to the author(s) by not deleting this reference
# (***) is: "docsite" (NOT USED ANYMORE)
# Dedicated branch for the site: "site"
# Name of the workflow
name: AndreaGrandieri/Deploy Jekyll site to Pages
on:
# Runs on pushes targeting the specified branch
push:
branches: ["site"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
# List of jobs
jobs:
# Build job
build:
# Requested OS to the runner
runs-on: ubuntu-latest
steps:
# Checking out the repository. No need to modify the working directory
- name: Repository Checkout
uses: actions/checkout@v3
# Setting up Ruby (installing it). The "bundle install" command will be skipped due to an old necessity present in version: A and not refactored. There's no loss in performances.
- name: Setup Ruby
uses: ruby/setup-ruby@0a29871fe2b0200a17a4497bae54fe5df0d973aa # v1.115.3
with:
# Not needed with a .ruby-version file
ruby-version: '3.0'
# runs 'bundle install' and caches installed gems automatically
# Setting to false will skip the command "bundle install". Should be put to false since "bundle install" is run in the next step
bundler-cache: false
# Runs command: "bundle", a Ruby command
- name: Run "bundle"
# There's no point in running "bundle cache": the GitHub Action's runner gets destroyed after the workflow is done. Thus, no cache will be used
run: bundle
# Runs command: bundle exec jekyll build, a Ruby command
- name: Run "bundle exec jekyll build"
run: bundle exec jekyll build
# Retrives the "_site" output generated by the run of "bundle exec jekyll build". This folder is saved on the current being used runner; if not exported, it will be lost since the runner gets destroyed at the end of the workflow. Generally speaking, workflows outputs are called: "Artifacts"
- name: Retrive "_site" output from runner
uses: actions/upload-pages-artifact@v1
with:
# The artifact to be exported is: "_site"
path: _site
# Deploy job
deploy:
# Requested OS to the runner
runs-on: ubuntu-latest
# Awaits the "build" job to be completed with success before starting. A fail in the "build" job will prevent the start of this job
needs: build
steps:
# Deploys to GitHub Pages. The site gets by default deployed to the following URL: "https://{your_github_account_name}.github.io/{repo_name}"
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v1