Update CHANGES.md #74
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
# This workflow uses actions that are not certified by GitHub. | |
# They are provided by a third-party and are governed by | |
# separate terms of service, privacy policy, and support | |
# documentation. | |
# Sample workflow for building and deploying a Jekyll site to GitHub Pages | |
name: Deploy Jekyll site to Pages | |
on: | |
push: | |
branches: ["main","TdSE2024"] | |
workflow_dispatch: | |
env: | |
BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | |
# Allows you to run this workflow manually from the Actions tab | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
contents: write | |
pages: write | |
id-token: write | |
# Allow one concurrent deployment | |
concurrency: | |
group: "pages" | |
cancel-in-progress: true | |
jobs: | |
# Build job | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.3' # Not needed with a .ruby-version file | |
bundler-cache: true # runs 'bundle install' and caches installed gems automatically | |
cache-version: 0 # Increment this number if you need to re-download cached gems | |
- name: Setup Pages | |
id: pages | |
uses: actions/configure-pages@v5 | |
- name: Configure | |
shell: bash | |
env: | |
TARGET_FOLDER: "" | |
EXTRA_CONFIG: ${{ inputs.extra-config }} | |
run: | | |
[[ ${RUNNER_DEBUG:-0} -eq 1 ]] && set -x | |
[[ "$BRANCH_NAME" != "main" ]] && TARGET_FOLDER="${{ github.ref_name }}" | |
echo "TARGET_FOLDER=$(echo $TARGET_FOLDER)" >> $GITHUB_ENV | |
REPO_NAME=$(jq -r ".repository.name" "$GITHUB_EVENT_PATH") | |
echo $TARGET_FOLDER | |
echo $REPO_NAME | |
TEMP_CONFIG=$(mktemp) | |
# avoid look up of API as it doesn't work from within actions without exposing the GITHUB_TOKEN here which is a security risk | |
cat <<EOF >> ${TEMP_CONFIG} | |
repository_nwo: ${GITHUB_REPOSITORY} | |
EOF | |
if [[ -n "${TARGET_FOLDER}" ]] | |
then | |
#echo "baseurl: /${REPO_NAME}/version/${TARGET_FOLDER}" >> ${TEMP_CONFIG} | |
echo "baseurl: /version/${TARGET_FOLDER}" >> ${TEMP_CONFIG} | |
echo "setting baseurl to /version/${TARGET_FOLDER}" | |
else | |
#echo "baseurl: /${REPO_NAME}" >> ${TEMP_CONFIG} | |
echo 'baseurl: ""' >> ${TEMP_CONFIG} | |
echo " setting baseurl to empty string" | |
fi | |
# allow override of everything | |
cat <<EOF >> ${TEMP_CONFIG} | |
${EXTRA_CONFIG} | |
EOF | |
echo "Adding additional config settings:" | |
cat ${TEMP_CONFIG} | tee -a _config.yml | |
- name: Build with Jekyll | |
# Outputs to the './_site' directory by default | |
run: bundle exec jekyll build --destination build | |
#run: bundle exec jekyll build --destination build | |
env: | |
JEKYLL_ENV: production | |
- name: Deploy To gh-pages Branch 🚀 | |
uses: JamesIves/[email protected] | |
with: | |
branch: gh-pages | |
folder: build | |
force: false | |
target-folder: ${{ env.BRANCH_NAME != 'main' && format('version/{0}',env.BRANCH_NAME) || '' }} | |
clean-exclude: | | |
pr-preview/ | |
version/ | |
# - name: Upload artifact | |
# # Automatically uploads an artifact from the './_site' directory by default | |
# with: | |
# path: build/ | |
# uses: actions/upload-pages-artifact@v3 | |
# # Deploy job | |
# deploy: | |
# # Add a dependency to the build job | |
# needs: build | |
# | |
# # Grant GITHUB_TOKEN the permissions required to make a Pages deployment | |
# permissions: | |
# pages: write # to deploy to Pages | |
# id-token: write # to verify the deployment originates from an appropriate source | |
# | |
# # Deploy to the github-pages environment | |
# environment: | |
# name: github-pages | |
# url: ${{ steps.deployment.outputs.page_url }} | |
# | |
# # Specify runner + deployment step | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: Deploy to GitHub Pages | |
# id: deployment | |
# uses: actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action |