Compare commits

..

1 Commits

Author SHA1 Message Date
Yoann Chaudet 9383201396 Add a test to validate read/write permissions 2022-02-07 18:47:45 -08:00
45 changed files with 369 additions and 420 deletions
-17
View File
@@ -1,17 +0,0 @@
version: 2
updates:
- package-ecosystem: "bundler"
directory: "/"
schedule:
interval: "weekly"
groups:
non-breaking-changes:
update-types: [minor, patch]
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
groups:
non-breaking-changes:
update-types: [minor, patch]
+1 -3
View File
@@ -3,10 +3,8 @@ name-template: 'v$RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION'
template: |
# Changelog
$CHANGES
See details of [all code changes](https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION) since previous release.
See details of [all code changes](https://github.com/actions/jekyll-build-pages/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION) since previous release
categories:
- title: '🚀 Features'
labels:
+10 -5
View File
@@ -24,12 +24,12 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v2
# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v3
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
@@ -43,20 +43,25 @@ jobs:
else
tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}
fi
echo "tags=$tags" >> $GITHUB_OUTPUT
echo "::set-output name=tags::$tags"
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
uses: docker/metadata-action@v3
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
uses: docker/build-push-action@v6
uses: docker/build-push-action@v2
with:
context: .
file: Dockerfile
push: true
tags: ${{ steps.generate-image-tags.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
# Drafts your next Release notes as Pull Requests are merged into "main"
- uses: release-drafter/release-drafter@v5
if: github.ref_name == 'main'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-17
View File
@@ -1,17 +0,0 @@
name: Draft release
on:
push:
branches:
- main
permissions:
contents: write
jobs:
draft-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: release-drafter/release-drafter@3f0f87098bd6b5c5b9a36d49c41d998ea58f9348
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+53 -52
View File
@@ -3,65 +3,66 @@ name: Record Expected
on:
workflow_dispatch:
env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}
jobs:
resolve-image-tag:
record-expected-output:
runs-on: ubuntu-latest
outputs:
tag: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.regex-match.outputs.group1 }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Grep action.yaml content
id: grep-image-content
run: |
image=$(grep -E "jekyll-build-pages.*\'" action.yml)
echo "image=$image" >> $GITHUB_OUTPUT
- uses: actions-ecosystem/action-regex-match@v2
id: regex-match
with:
text: ${{ steps.grep-image-content.outputs.image }}
regex: "jekyll-build-pages:(.*)'"
uses: actions/checkout@v2
test-builds:
needs: resolve-image-tag
runs-on: ubuntu-latest
strategy:
matrix:
test:
- simple
- readme
- octicons
- mojombo
- themes
- jekyll-include-cache
- future-false
- future-true
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build local docker image
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile
tags: ${{ needs.resolve-image-tag.outputs.tag }}
- name: Build ${{ matrix.test }} Project
- name: Build test project 'simple'
uses: ./
with:
source: ./test_projects/${{ matrix.test }}
destination: ./test_projects/${{ matrix.test }}/_expected
source: test_projects/simple
destination: test_projects/simple/_expected
build_revision: JEKYLL_BUILD_REVISION
token: ${{ secrets.GITHUB_TOKEN }}
- name: Archive ${{ matrix.test }} Project
uses: actions/upload-artifact@v4
- name: Build test project 'readme'
uses: ./
with:
name: ${{ matrix.test }}
path: ./test_projects/${{ matrix.test }}/_expected
source: test_projects/readme
destination: test_projects/readme/_expected
build_revision: JEKYLL_BUILD_REVISION
- name: Build test project 'octicons'
uses: ./
with:
source: test_projects/octicons
destination: test_projects/octicons/_expected
build_revision: JEKYLL_BUILD_REVISION
- name: Build test project 'mojombo'
uses: ./
with:
source: test_projects/mojombo
destination: test_projects/mojombo/_expected
build_revision: JEKYLL_BUILD_REVISION
- name: Build test project 'themes'
uses: ./
with:
source: test_projects/themes
destination: test_projects/themes/_expected
build_revision: JEKYLL_BUILD_REVISION
- name: Build test project 'jekyll-include-cache'
uses: ./
with:
source: test_projects/jekyll-include-cache
destination: test_projects/jekyll-include-cache/_expected
build_revision: JEKYLL_BUILD_REVISION
- name: Build test project 'future-false'
uses: ./
with:
source: test_projects/future-false
destination: test_projects/future-false/_expected
build_revision: JEKYLL_BUILD_REVISION
- name: Build test project 'future-true'
uses: ./
with:
source: test_projects/future-true
destination: test_projects/future-true/_expected
build_revision: JEKYLL_BUILD_REVISION
@@ -1,11 +1,11 @@
name: Release
name: Release new action version
on:
release:
types: [released]
types: [edited]
workflow_dispatch:
inputs:
TAG_NAME:
description: "Tag name that the major tag will point to"
description: 'Tag name that the major tag will point to'
required: true
env:
@@ -13,20 +13,17 @@ env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
permissions:
contents: write
jobs:
verify_release:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v2
- name: Grep action.yaml content
id: grep-image-content
run: |
image=$(grep -E "jekyll-build-pages.*\'" action.yml)
echo "image=$image" >> $GITHUB_OUTPUT
echo "::set-output name=image::$image"
- uses: actions-ecosystem/action-regex-match@v2
id: regex-match
with:
@@ -40,19 +37,18 @@ jobs:
fi
- name: Verify image published
run: docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.TAG_NAME }}
update_tag:
needs: verify_release
name: Update the major tag to include the ${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }} changes
environment:
# Note: this environment is protected
name: Release
name: releaseNewActionVersion
runs-on: ubuntu-latest
outputs:
major_tag: ${{ steps.update-major-tag.outputs.major-tag }}
steps:
- name: Update the ${{ env.TAG_NAME }} major tag
id: update-major-tag
uses: actions/publish-action@v0.3.0
with:
source-tag: ${{ env.TAG_NAME }}
- name: Update the ${{ env.TAG_NAME }} tag
id: update-major-tag
uses: actions/publish-action@v0.1.0
with:
source-tag: ${{ env.TAG_NAME }}
slack-webhook: ${{ secrets.SLACK_WEBHOOK }}
+2 -4
View File
@@ -4,8 +4,6 @@ on:
pull_request:
paths:
- '**.sh'
# this is too wide but will cover shell scripts without an extension in that folder
- 'bin/*'
jobs:
shellcheck:
@@ -14,10 +12,10 @@ jobs:
SHELLCHECK_OPTS: -s bash
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v2
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
uses: ludeeus/action-shellcheck@94e0aab03ca135d11a35e5bfc14e6746dc56e7e9
with:
version: v0.8.0
format: tty
+229 -21
View File
@@ -1,10 +1,14 @@
name: "Test"
name: 'Test'
on:
push:
branches:
- main
paths-ignore:
- 'README.md'
pull_request:
paths-ignore:
- 'README.md'
env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
@@ -18,49 +22,253 @@ jobs:
tag: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.regex-match.outputs.group1 }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v2
- name: Grep action.yaml content
id: grep-image-content
run: |
image=$(grep -E "jekyll-build-pages.*\'" action.yml)
echo "image=$image" >> $GITHUB_OUTPUT
echo "::set-output name=image::$image"
- uses: actions-ecosystem/action-regex-match@v2
id: regex-match
with:
text: ${{ steps.grep-image-content.outputs.image }}
regex: "jekyll-build-pages:(.*)'"
test-builds:
test-simple:
needs: resolve-image-tag
runs-on: ubuntu-latest
strategy:
matrix:
test:
- simple
- readme
- octicons
- mojombo
- themes
- jekyll-include-cache
- future-false
- future-true
env:
TEST_NAME: simple
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v2
- name: Build local docker image
uses: docker/build-push-action@v6
uses: docker/build-push-action@v2
with:
context: .
file: Dockerfile
tags: ${{ needs.resolve-image-tag.outputs.tag }}
- name: Test ${{ matrix.test }} Project
- name: Test ${{ env.TEST_NAME }} Project
uses: ./
with:
source: ./test_projects/${{ matrix.test }}
destination: ./test_projects/${{ matrix.test }}/_site
source: ./test_projects/${{ env.TEST_NAME }}
destination: ./test_projects/${{ env.TEST_NAME }}/_site
build_revision: JEKYLL_BUILD_REVISION
token: ${{ secrets.GITHUB_TOKEN }}
- name: Verify output
run: |
./bin/compare_expected_output ./test_projects/${{matrix.test}}
./bin/compare_expected_output ./test_projects/${{env.TEST_NAME}}
test-readme:
needs: resolve-image-tag
runs-on: ubuntu-latest
env:
TEST_NAME: readme
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Build local docker image
uses: docker/build-push-action@v2
with:
context: .
file: Dockerfile
tags: ${{ needs.resolve-image-tag.outputs.tag }}
- name: Test ${{ env.TEST_NAME }} Project
uses: ./
with:
source: ./test_projects/${{ env.TEST_NAME }}
destination: ./test_projects/${{ env.TEST_NAME }}/_site
build_revision: JEKYLL_BUILD_REVISION
token: ${{ secrets.GITHUB_TOKEN }}
- name: Verify output
run: |
./bin/compare_expected_output ./test_projects/${{env.TEST_NAME}}
test-octicons:
needs: resolve-image-tag
runs-on: ubuntu-latest
env:
TEST_NAME: octicons
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Build local docker image
uses: docker/build-push-action@v2
with:
context: .
file: Dockerfile
tags: ${{ needs.resolve-image-tag.outputs.tag }}
- name: Test ${{ env.TEST_NAME }} Project
uses: ./
with:
source: ./test_projects/${{ env.TEST_NAME }}
destination: ./test_projects/${{ env.TEST_NAME }}/_site
build_revision: JEKYLL_BUILD_REVISION
token: ${{ secrets.GITHUB_TOKEN }}
- name: Verify output
run: |
./bin/compare_expected_output ./test_projects/${{env.TEST_NAME}}
test-mojombo:
needs: resolve-image-tag
runs-on: ubuntu-latest
env:
TEST_NAME: mojombo
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Build local docker image
uses: docker/build-push-action@v2
with:
context: .
file: Dockerfile
tags: ${{ needs.resolve-image-tag.outputs.tag }}
- name: Test ${{ env.TEST_NAME }} Project
uses: ./
with:
source: ./test_projects/${{ env.TEST_NAME }}
destination: ./test_projects/${{ env.TEST_NAME }}/_site
build_revision: JEKYLL_BUILD_REVISION
token: ${{ secrets.GITHUB_TOKEN }}
- name: Verify output
run: |
./bin/compare_expected_output ./test_projects/${{env.TEST_NAME}}
test-themes:
needs: resolve-image-tag
runs-on: ubuntu-latest
env:
TEST_NAME: themes
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Build local docker image
uses: docker/build-push-action@v2
with:
context: .
file: Dockerfile
tags: ${{ needs.resolve-image-tag.outputs.tag }}
- name: Test ${{ env.TEST_NAME }} Project
uses: ./
with:
source: ./test_projects/${{ env.TEST_NAME }}
destination: ./test_projects/${{ env.TEST_NAME }}/_site
build_revision: JEKYLL_BUILD_REVISION
token: ${{ secrets.GITHUB_TOKEN }}
- name: Verify output
run: |
./bin/compare_expected_output ./test_projects/${{env.TEST_NAME}}
test-jekyll-include-cache:
needs: resolve-image-tag
runs-on: ubuntu-latest
env:
TEST_NAME: jekyll-include-cache
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Build local docker image
uses: docker/build-push-action@v2
with:
context: .
file: Dockerfile
tags: ${{ needs.resolve-image-tag.outputs.tag }}
- name: Test ${{ env.TEST_NAME }} Project
uses: ./
with:
source: ./test_projects/${{ env.TEST_NAME }}
destination: ./test_projects/${{ env.TEST_NAME }}/_site
build_revision: JEKYLL_BUILD_REVISION
token: ${{ secrets.GITHUB_TOKEN }}
- name: Verify output
run: |
./bin/compare_expected_output ./test_projects/${{env.TEST_NAME}}
test-future-false:
needs: resolve-image-tag
runs-on: ubuntu-latest
env:
TEST_NAME: future-false
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Build local docker image
uses: docker/build-push-action@v2
with:
context: .
file: Dockerfile
tags: ${{ needs.resolve-image-tag.outputs.tag }}
- name: Test ${{ env.TEST_NAME }} Project
uses: ./
with:
source: ./test_projects/${{ env.TEST_NAME }}
destination: ./test_projects/${{ env.TEST_NAME }}/_site
build_revision: JEKYLL_BUILD_REVISION
token: ${{ secrets.GITHUB_TOKEN }}
- name: Verify output
run: |
./bin/compare_expected_output ./test_projects/${{env.TEST_NAME}}
test-future-true:
needs: resolve-image-tag
runs-on: ubuntu-latest
env:
TEST_NAME: future-true
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Build local docker image
uses: docker/build-push-action@v2
with:
context: .
file: Dockerfile
tags: ${{ needs.resolve-image-tag.outputs.tag }}
- name: Test ${{ env.TEST_NAME }} Project
uses: ./
with:
source: ./test_projects/${{ env.TEST_NAME }}
destination: ./test_projects/${{ env.TEST_NAME }}/_site
build_revision: JEKYLL_BUILD_REVISION
token: ${{ secrets.GITHUB_TOKEN }}
- name: Verify output
run: |
./bin/compare_expected_output ./test_projects/${{env.TEST_NAME}}
test-runner-has-permission:
needs: resolve-image-tag
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Build local docker image
uses: docker/build-push-action@v2
with:
context: .
file: Dockerfile
tags: ${{ needs.resolve-image-tag.outputs.tag }}
- name: Build simple project
uses: ./
with:
source: ./test_projects/simple
destination: ./test_projects/simple/_site
build_revision: JEKYLL_BUILD_REVISION
token: ${{ secrets.GITHUB_TOKEN }}
- name: Verify permissions on the build assets
run: |
if ! [[ -r ./test_projects/simple/_site/index.html ]]; then
echo '::error::Read permission is missing' && exit 1
fi
if ! [[ -w ./test_projects/simple/_site/index.html ]]; then
echo '::error::Write permission is missing' && exit 1
fi
shell: bash
+2 -1
View File
@@ -1,4 +1,4 @@
ARG RUBY_VERSION=3.3
ARG RUBY_VERSION=2.7.4
FROM ruby:$RUBY_VERSION-slim
RUN apt-get update \
@@ -22,3 +22,4 @@ ENV LC_ALL en_US.UTF-8
COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
+1 -1
View File
@@ -5,7 +5,7 @@ source "https://rubygems.org"
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
# Manage our dependency on the version of the github-pages gem here.
gem "github-pages", "= 232"
gem "github-pages", "= 223"
# Explicitly include this gem here.
# It is not directly included in the github-pages gem list of dependencies,
+5 -92
View File
@@ -1,102 +1,15 @@
# jekyll-build-pages
# Jekyll-Build-Pages
A simple GitHub Action for producing Jekyll build artifacts compatible with GitHub Pages.
## Scope
# Scope
This is used along with [`actions/deploy-pages`](https://github.com/actions/deploy-pages) as part of the official support for building Pages with Actions (currently in public beta for public repositories).
## Usage
# Usage
A basic Pages deployment workflow with the `jekyll-build-pages` action looks like this.
See [action.yml](action.yml)
```yaml
name: Build Jekyll site
on:
push:
branches: ["main"]
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Build
uses: actions/jekyll-build-pages@v1
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
deploy:
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
```
To write to a different destination directory, match the inputs of both the `jekyll-build-pages` and [`upload-pages-artifact`](https://github.com/actions/upload-pages-artifact) actions.
```yaml
steps:
- name: Build
uses: actions/jekyll-build-pages@v1
with:
destination: "./output"
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: "./output"
```
### Action inputs
| Input | Default | Description |
|-------|---------|-------------|
| `source` | `./` | The directory to build from |
| `destination` | `./_site` | The directory to write output into<br>(this should match the `path` input of the [`actions/upload-pages-artifact`](https://github.com/actions/upload-pages-artifact) action) |
| `future` | `false` | If `true`, writes content dated in the future |
| `build_revision` | `$GITHUB_SHA` | The SHA-1 of the Git commit for which the build is running |
| `verbose` | `false` | If `true`, prints verbose output in logs |
| `token` | `$GITHUB_TOKEN` | The GitHub token used to authenticate API requests |
## Release instructions
In order to release a new version of this Action:
1. Locate the semantic version of the [upcoming release][release-list] (a draft is maintained by the [`draft-release` workflow][draft-release]).
2. Prepare a pull request to update [`action.yml`][action.yml] to reference the incoming version, get it approved, and merge it into the `main` branch.
3. Publish the draft release **as a pre-release** from the `main` branch with semantic version as the tag name, _with_:
- the checkbox to publish to the GitHub Marketplace checked :ballot_box_with_check:
- :warning: _AND_ the checkbox to **Set as a pre-release** checked. :ballot_box_with_check:
4. This will kick off a [Docker publishing workflow][docker-publish] for the newly created tag. Check the [associated workflow run list][docker-publish-workflow-runs] to verify the new Docker image is created successfully before moving on to the next step.
5. After the Docker image has been created with the new tag, find that [same pre-release][release-list] and edit it. Update it with the checkbox to **Set as the latest release** checked :ballot_box_with_check: and then publish it again.
6. After publishing it as the latest release, the [`release` workflow][release] will automatically run to create/update the corresponding the major version tag such as `v1`.
⚠️ Environment approval is required. Check the [Release workflow run list][release-workflow-runs].
## License
# License
The scripts and documentation in this project are released under the [MIT License](LICENSE).
<!-- references -->
[release-list]: https://github.com/actions/jekyll-build-pages/releases
[draft-release]: .github/workflows/draft-release.yml
[docker-publish]: .github/workflows/docker-publish.yml
[release]: .github/workflows/release.yml
[docker-publish-workflow-runs]: https://github.com/actions/jekyll-build-pages/actions/workflows/docker-publish.yml
[release-workflow-runs]: https://github.com/actions/jekyll-build-pages/actions/workflows/release.yml
[action.yml]: https://github.com/actions/jekyll-build-pages/blob/649f5d3c2b2462620c8945f034200e431ceddd29/action.yml#LL31C54-L31C60
+2 -3
View File
@@ -1,6 +1,5 @@
name: 'Build Jekyll for GitHub Pages'
name: 'Pages Jekyll'
description: 'A simple GitHub Action for producing Jekyll build artifacts compatible with GitHub Pages'
author: 'GitHub'
inputs:
source:
description: 'Directory where the source files reside.'
@@ -28,4 +27,4 @@ inputs:
default: ${{ github.token }}
runs:
using: 'docker'
image: 'docker://ghcr.io/actions/jekyll-build-pages:v1.0.13'
image: 'docker://ghcr.io/actions/jekyll-build-pages:v1.0.1'
+8 -8
View File
@@ -1,14 +1,14 @@
#! /usr/bin/env sh
if [ "local" = "$1" ]; then
export JEKYLL_ENV=production
export PAGES_REPO_NWO=actions/jekyll-build-pages
export JEKYLL_BUILD_REVISION=JEKYLL_BUILD_REVISION
export JEKYLL_ENV=production
export PAGES_REPO_NWO=actions/jekyll-build-pages
export JEKYLL_BUILD_REVISION=JEKYLL_BUILD_REVISION
for dir in test_projects/*
do
bundle exec github-pages build --verbose -s "test_projects/${dir}" -d "test_projects/${dir}/_expected"
done
for dir in $(ls test_projects)
do
bundle exec github-pages build --verbose -s test_projects/$dir -d test_projects/$dir/_expected
done
else
act -b -s GITHUB_TOKEN -j record-expected-output
act -b -s GITHUB_TOKEN -j record-expected-output
fi
-96
View File
@@ -1,96 +0,0 @@
#!/usr/bin/env pwsh
#Requires -Version 7.2
<#
.SYNOPSIS
Trigger the workflow that records the tests expected outputs, wait for its execution to finish,
then bring back those results locally.
.DESCRIPTION
This script is meant to run locally outside of Actions. It relies on `gh` and `git`.
#>
# Get the repository's path (ps1 extension on the script is required for PSScriptRoot to be available 🤦)
$repositoryPath = Resolve-Path (Join-Path $PSScriptRoot '..')
# Get the test_project's path
$testProjectsPath = Resolve-Path (Join-Path $PSScriptRoot '../test_projects')
#
# Utilities
#
# Run a command and validate it returned a 0 exit code
function Invoke-Command {
param (
[ScriptBlock] $Command
)
& $Command
if ($LASTEXITCODE -ne 0) {
Write-Error "Command failed: $Command"
throw
}
}
# Get the current git ref name
function Get-GitRef {
$commitId = Invoke-Command { & git -C $repositoryPath rev-parse --abbrev-ref HEAD }
$commitId.Trim()
}
# Create a temp folder and return its path
function New-TemporaryFolder {
$path = Join-Path ([System.IO.Path]::GetTempPath()) ([System.Guid]::NewGuid())
New-Item -ItemType 'Directory' -Path $path | Out-Null
$path
}
#
# Main
#
# Init
Set-StrictMode -version 'Latest'
$ErrorActionPreference = 'Stop'
# Get git ref name
$ref = Get-GitRef
# Run the workflow
Write-Host 'Queue workflow'
$workflow = 'record.yml'
Invoke-Command { & gh workflow run $workflow --ref $ref | Out-Null }
# Wait for a few seconds for the workflow to get created
Write-Host 'Wait a few seconds...'
Start-Sleep -Seconds 5
# Lookup the run id (it is not perfect because of the APIs...)
Write-Host 'Lookup run id'
$runId = Invoke-Command { & gh run list --workflow $workflow --branch $ref --limit 1 --json databaseId --jq '.[].databaseId' }
# Wait for the workflow to finish
Write-Host "Wait for workflow $runId to complete"
Invoke-Command { & gh run watch $runId --exit-status }
# Download the artifacts in a temp folder
Write-Host 'Download artifacts'
$tempFolder = New-TemporaryFolder
Invoke-Command { & gh run download $runId --dir $tempFolder }
# Iterate over the test projects
Get-ChildItem -Path $testProjectsPath -Directory | ForEach-Object {
# Construct the artifact path and make sure a matching artifact is found
$artifactPath = Join-Path $tempFolder $_.BaseName
if (Test-Path $artifactPath -PathType 'Container') {
# Copy artifact to the expected output folder
$destinationPath = Join-Path $testProjectsPath $_.BaseName '_expected'
Copy-Item -Path (Join-Path $artifactPath '*') -Destination $destinationPath -Recurse -Force | Out-Null
}
# Ignore test project
else {
Write-Warning "Unable to find artifact for test project $($_.BaseName)"
}
}
+8 -29
View File
@@ -1,27 +1,23 @@
#!/bin/bash
####################################################################################################
#######################################################################################################
#
# Calls github-pages executable to build the site using allowed plugins and supported configuration
# Calls github-pages executable to build the site using whitelisted plugins and supported configuration
#
####################################################################################################
#######################################################################################################
set -o errexit
SOURCE_DIRECTORY=${GITHUB_WORKSPACE}/$INPUT_SOURCE
DESTINATION_DIRECTORY=${GITHUB_WORKSPACE}/$INPUT_DESTINATION
PAGES_GEM_HOME=$BUNDLE_APP_CONFIG
GITHUB_PAGES_BIN=$PAGES_GEM_HOME/bin/github-pages
# Check if Gemfile's dependencies are satisfied or print a warning
if test -e "$SOURCE_DIRECTORY/Gemfile" && ! bundle check --dry-run --gemfile "$SOURCE_DIRECTORY/Gemfile"; then
echo "::warning::The github-pages gem can't satisfy your Gemfile's dependencies. If you want to use a different Jekyll version or need additional dependencies, consider building Jekyll site with GitHub Actions: https://jekyllrb.com/docs/continuous-integration/github-actions/"
fi
GITHUB_PAGES=$PAGES_GEM_HOME/bin/github-pages
# Set environment variables required by supported plugins
export JEKYLL_ENV="production"
export JEKYLL_GITHUB_TOKEN=$INPUT_TOKEN
export PAGES_REPO_NWO=$GITHUB_REPOSITORY
export JEKYLL_BUILD_REVISION=$INPUT_BUILD_REVISION
export PAGES_API_URL=$GITHUB_API_URL
# Set verbose flag
if [ "$INPUT_VERBOSE" = 'true' ]; then
@@ -37,22 +33,5 @@ else
FUTURE=''
fi
{ cd "$PAGES_GEM_HOME" || { echo "::error::pages gem not found"; exit 1; }; }
# Run the command, capturing the output
build_output="$($GITHUB_PAGES_BIN build "$VERBOSE" "$FUTURE" --source "$SOURCE_DIRECTORY" --destination "$DESTINATION_DIRECTORY")"
# Capture the exit code
exit_code=$?
if [ $exit_code -ne 0 ]; then
# Remove the newlines from the build_output as annotation not support multiline
error=$(echo "$build_output" | tr '\n' ' ' | tr -s ' ')
echo "::error::$error"
else
# Display the build_output directly
echo "$build_output"
fi
# Exit with the captured exit code
exit $exit_code
cd "$PAGES_GEM_HOME"
$GITHUB_PAGES build "$VERBOSE" "$FUTURE" --source "$SOURCE_DIRECTORY" --destination "$DESTINATION_DIRECTORY"
@@ -5,9 +5,9 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Begin Jekyll SEO tag v2.8.0 -->
<!-- Begin Jekyll SEO tag v2.7.1 -->
<title>The Future is Looking Bright! | jekyll-build-pages</title>
<meta name="generator" content="Jekyll v3.10.0" />
<meta name="generator" content="Jekyll v3.9.0" />
<meta property="og:title" content="The Future is Looking Bright!" />
<meta property="og:locale" content="en_US" />
<meta name="description" content="Everythings coming up Milhouse." />
@@ -20,7 +20,7 @@
<meta name="twitter:card" content="summary" />
<meta property="twitter:title" content="The Future is Looking Bright!" />
<script type="application/ld+json">
{"@context":"https://schema.org","@type":"BlogPosting","dateModified":"2020-02-13T00:00:00-05:00","datePublished":"2020-02-13T00:00:00-05:00","description":"Everythings coming up Milhouse.","headline":"The Future is Looking Bright!","mainEntityOfPage":{"@type":"WebPage","@id":"https://github.com/pages/actions/jekyll-build-pages/2020/02/13/the-future-is-looking-bright.html"},"url":"https://github.com/pages/actions/jekyll-build-pages/2020/02/13/the-future-is-looking-bright.html"}</script>
{"mainEntityOfPage":{"@type":"WebPage","@id":"https://github.com/pages/actions/jekyll-build-pages/2020/02/13/the-future-is-looking-bright.html"},"description":"Everythings coming up Milhouse.","url":"https://github.com/pages/actions/jekyll-build-pages/2020/02/13/the-future-is-looking-bright.html","@type":"BlogPosting","headline":"The Future is Looking Bright!","dateModified":"2020-02-13T00:00:00-05:00","datePublished":"2020-02-13T00:00:00-05:00","@context":"https://schema.org"}</script>
<!-- End Jekyll SEO tag -->
<link rel="stylesheet" href="/pages/actions/jekyll-build-pages/assets/css/style.css?v=JEKYLL_BUILD_REVISION">
@@ -5,9 +5,9 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Begin Jekyll SEO tag v2.8.0 -->
<!-- Begin Jekyll SEO tag v2.7.1 -->
<title>The Future is Looking Bright! | jekyll-build-pages</title>
<meta name="generator" content="Jekyll v3.10.0" />
<meta name="generator" content="Jekyll v3.9.0" />
<meta property="og:title" content="The Future is Looking Bright!" />
<meta property="og:locale" content="en_US" />
<meta name="description" content="Everythings coming up Milhouse." />
@@ -20,7 +20,7 @@
<meta name="twitter:card" content="summary" />
<meta property="twitter:title" content="The Future is Looking Bright!" />
<script type="application/ld+json">
{"@context":"https://schema.org","@type":"BlogPosting","dateModified":"2020-02-13T00:00:00-05:00","datePublished":"2020-02-13T00:00:00-05:00","description":"Everythings coming up Milhouse.","headline":"The Future is Looking Bright!","mainEntityOfPage":{"@type":"WebPage","@id":"https://github.com/pages/actions/jekyll-build-pages/2020/02/13/the-future-is-looking-bright.html"},"url":"https://github.com/pages/actions/jekyll-build-pages/2020/02/13/the-future-is-looking-bright.html"}</script>
{"mainEntityOfPage":{"@type":"WebPage","@id":"https://github.com/pages/actions/jekyll-build-pages/2020/02/13/the-future-is-looking-bright.html"},"description":"Everythings coming up Milhouse.","url":"https://github.com/pages/actions/jekyll-build-pages/2020/02/13/the-future-is-looking-bright.html","@type":"BlogPosting","headline":"The Future is Looking Bright!","dateModified":"2020-02-13T00:00:00-05:00","datePublished":"2020-02-13T00:00:00-05:00","@context":"https://schema.org"}</script>
<!-- End Jekyll SEO tag -->
<link rel="stylesheet" href="/pages/actions/jekyll-build-pages/assets/css/style.css?v=JEKYLL_BUILD_REVISION">
@@ -5,9 +5,9 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Begin Jekyll SEO tag v2.8.0 -->
<!-- Begin Jekyll SEO tag v2.7.1 -->
<title>We Live In Hell | jekyll-build-pages</title>
<meta name="generator" content="Jekyll v3.10.0" />
<meta name="generator" content="Jekyll v3.9.0" />
<meta property="og:title" content="We Live In Hell" />
<meta property="og:locale" content="en_US" />
<meta name="description" content="And its not even the cool hell that [redacted] are afraid of. 😭" />
@@ -20,7 +20,7 @@
<meta name="twitter:card" content="summary" />
<meta property="twitter:title" content="We Live In Hell" />
<script type="application/ld+json">
{"@context":"https://schema.org","@type":"BlogPosting","dateModified":"2022-03-01T00:00:00-05:00","datePublished":"2022-03-01T00:00:00-05:00","description":"And its not even the cool hell that [redacted] are afraid of. 😭","headline":"We Live In Hell","mainEntityOfPage":{"@type":"WebPage","@id":"https://github.com/pages/actions/jekyll-build-pages/2022/03/01/we-live-in-hell.html"},"url":"https://github.com/pages/actions/jekyll-build-pages/2022/03/01/we-live-in-hell.html"}</script>
{"mainEntityOfPage":{"@type":"WebPage","@id":"https://github.com/pages/actions/jekyll-build-pages/2022/03/01/we-live-in-hell.html"},"description":"And its not even the cool hell that [redacted] are afraid of. 😭","url":"https://github.com/pages/actions/jekyll-build-pages/2022/03/01/we-live-in-hell.html","@type":"BlogPosting","headline":"We Live In Hell","dateModified":"2022-03-01T00:00:00-05:00","datePublished":"2022-03-01T00:00:00-05:00","@context":"https://schema.org"}</script>
<!-- End Jekyll SEO tag -->
<link rel="stylesheet" href="/pages/actions/jekyll-build-pages/assets/css/style.css?v=JEKYLL_BUILD_REVISION">
@@ -5,21 +5,18 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Begin Jekyll SEO tag v2.8.0 -->
<title>jekyll-build-pages | A simple GitHub Action for producing Jekyll build artifacts compatible with GitHub Pages.</title>
<meta name="generator" content="Jekyll v3.10.0" />
<!-- Begin Jekyll SEO tag v2.7.1 -->
<title>jekyll-build-pages</title>
<meta name="generator" content="Jekyll v3.9.0" />
<meta property="og:title" content="jekyll-build-pages" />
<meta property="og:locale" content="en_US" />
<meta name="description" content="A simple GitHub Action for producing Jekyll build artifacts compatible with GitHub Pages." />
<meta property="og:description" content="A simple GitHub Action for producing Jekyll build artifacts compatible with GitHub Pages." />
<link rel="canonical" href="https://github.com/pages/actions/jekyll-build-pages/" />
<meta property="og:url" content="https://github.com/pages/actions/jekyll-build-pages/" />
<meta property="og:site_name" content="jekyll-build-pages" />
<meta property="og:type" content="website" />
<meta name="twitter:card" content="summary" />
<meta property="twitter:title" content="jekyll-build-pages" />
<script type="application/ld+json">
{"@context":"https://schema.org","@type":"WebSite","description":"A simple GitHub Action for producing Jekyll build artifacts compatible with GitHub Pages.","headline":"jekyll-build-pages","name":"jekyll-build-pages","url":"https://github.com/pages/actions/jekyll-build-pages/"}</script>
{"headline":"jekyll-build-pages","url":"https://github.com/pages/actions/jekyll-build-pages/","@type":"WebSite","name":"jekyll-build-pages","@context":"https://schema.org"}</script>
<!-- End Jekyll SEO tag -->
<link rel="stylesheet" href="/pages/actions/jekyll-build-pages/assets/css/style.css?v=JEKYLL_BUILD_REVISION">
+6 -10
View File
@@ -13,7 +13,6 @@ GEM
execjs
coffee-script-source (1.10.0)
colorator (1.1.0)
concurrent-ruby (1.1.10)
ethon (0.9.1)
ffi (>= 1.3.0)
execjs (2.7.0)
@@ -54,8 +53,7 @@ GEM
html-pipeline (2.4.2)
activesupport (>= 2)
nokogiri (>= 1.4)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
i18n (0.7.0)
jekyll (3.3.0)
addressable (~> 2.4)
colorator (~> 1.0)
@@ -103,20 +101,18 @@ GEM
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9.7)
mercenary (0.3.6)
mini_portile2 (2.8.5)
mini_portile2 (2.1.0)
minima (2.0.0)
minitest (5.9.1)
multipart-post (2.0.0)
net-dns (0.8.0)
nokogiri (1.16.2)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
nokogiri (1.6.8.1)
mini_portile2 (~> 2.1.0)
octokit (4.6.0)
sawyer (~> 0.8.0, >= 0.5.3)
pathutil (0.14.0)
forwardable-extended (~> 2.6)
public_suffix (1.5.3)
racc (1.7.3)
rb-fsevent (0.9.8)
rb-inotify (0.9.7)
ffi (>= 0.5.0)
@@ -128,10 +124,10 @@ GEM
faraday (~> 0.8, < 0.10)
terminal-table (1.7.3)
unicode-display_width (~> 1.1.1)
thread_safe (0.3.6)
thread_safe (0.3.5)
typhoeus (0.8.0)
ethon (>= 0.8.0)
tzinfo (1.2.10)
tzinfo (1.2.2)
thread_safe (~> 0.1)
unicode-display_width (1.1.1)
+2 -2
View File
@@ -881,8 +881,8 @@ format. You can find the full spec at &lt;a href=&quot;http://tomdoc.org&quot;&g
&lt;span class=&quot;c1&quot;&gt;#&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# Examples&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;#&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# multiplex(&apos;Tom&apos;, 4)&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# # =&amp;gt; &apos;TomTomTomTom&apos;&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# multiplex('Tom', 4)&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# # =&amp;gt; 'TomTomTomTom'&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;#&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;# Returns the duplicated String.&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;multiplex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;count&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
+3 -6
View File
@@ -5,21 +5,18 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Begin Jekyll SEO tag v2.8.0 -->
<!-- Begin Jekyll SEO tag v2.7.1 -->
<title>Readme Test | jekyll-build-pages</title>
<meta name="generator" content="Jekyll v3.10.0" />
<meta name="generator" content="Jekyll v3.9.0" />
<meta property="og:title" content="Readme Test" />
<meta property="og:locale" content="en_US" />
<meta name="description" content="A simple GitHub Action for producing Jekyll build artifacts compatible with GitHub Pages." />
<meta property="og:description" content="A simple GitHub Action for producing Jekyll build artifacts compatible with GitHub Pages." />
<link rel="canonical" href="https://github.com/pages/actions/jekyll-build-pages/" />
<meta property="og:url" content="https://github.com/pages/actions/jekyll-build-pages/" />
<meta property="og:site_name" content="jekyll-build-pages" />
<meta property="og:type" content="website" />
<meta name="twitter:card" content="summary" />
<meta property="twitter:title" content="Readme Test" />
<script type="application/ld+json">
{"@context":"https://schema.org","@type":"WebSite","description":"A simple GitHub Action for producing Jekyll build artifacts compatible with GitHub Pages.","headline":"Readme Test","name":"jekyll-build-pages","url":"https://github.com/pages/actions/jekyll-build-pages/"}</script>
{"url":"https://github.com/pages/actions/jekyll-build-pages/","@type":"WebSite","headline":"Readme Test","name":"jekyll-build-pages","@context":"https://schema.org"}</script>
<!-- End Jekyll SEO tag -->
<link rel="stylesheet" href="/pages/actions/jekyll-build-pages/assets/css/style.css?v=JEKYLL_BUILD_REVISION">
+3 -6
View File
@@ -5,21 +5,18 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Begin Jekyll SEO tag v2.8.0 -->
<!-- Begin Jekyll SEO tag v2.7.1 -->
<title>Readme Test | jekyll-build-pages</title>
<meta name="generator" content="Jekyll v3.10.0" />
<meta name="generator" content="Jekyll v3.9.0" />
<meta property="og:title" content="Readme Test" />
<meta property="og:locale" content="en_US" />
<meta name="description" content="A simple GitHub Action for producing Jekyll build artifacts compatible with GitHub Pages." />
<meta property="og:description" content="A simple GitHub Action for producing Jekyll build artifacts compatible with GitHub Pages." />
<link rel="canonical" href="https://github.com/pages/actions/jekyll-build-pages/" />
<meta property="og:url" content="https://github.com/pages/actions/jekyll-build-pages/" />
<meta property="og:site_name" content="jekyll-build-pages" />
<meta property="og:type" content="website" />
<meta name="twitter:card" content="summary" />
<meta property="twitter:title" content="Readme Test" />
<script type="application/ld+json">
{"@context":"https://schema.org","@type":"WebSite","description":"A simple GitHub Action for producing Jekyll build artifacts compatible with GitHub Pages.","headline":"Readme Test","name":"jekyll-build-pages","url":"https://github.com/pages/actions/jekyll-build-pages/"}</script>
{"url":"https://github.com/pages/actions/jekyll-build-pages/","@type":"WebSite","headline":"Readme Test","name":"jekyll-build-pages","@context":"https://schema.org"}</script>
<!-- End Jekyll SEO tag -->
<link rel="stylesheet" href="/pages/actions/jekyll-build-pages/assets/css/style.css?v=JEKYLL_BUILD_REVISION">
+4 -7
View File
@@ -5,21 +5,18 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Begin Jekyll SEO tag v2.8.0 -->
<title>Jekyll Actions Demo | A simple GitHub Action for producing Jekyll build artifacts compatible with GitHub Pages.</title>
<meta name="generator" content="Jekyll v3.10.0" />
<!-- Begin Jekyll SEO tag v2.7.1 -->
<title>Jekyll Actions Demo</title>
<meta name="generator" content="Jekyll v3.9.0" />
<meta property="og:title" content="Jekyll Actions Demo" />
<meta property="og:locale" content="en_US" />
<meta name="description" content="A simple GitHub Action for producing Jekyll build artifacts compatible with GitHub Pages." />
<meta property="og:description" content="A simple GitHub Action for producing Jekyll build artifacts compatible with GitHub Pages." />
<link rel="canonical" href="https://github.com/pages/actions/jekyll-build-pages/" />
<meta property="og:url" content="https://github.com/pages/actions/jekyll-build-pages/" />
<meta property="og:site_name" content="Jekyll Actions Demo" />
<meta property="og:type" content="website" />
<meta name="twitter:card" content="summary" />
<meta property="twitter:title" content="Jekyll Actions Demo" />
<script type="application/ld+json">
{"@context":"https://schema.org","@type":"WebSite","description":"A simple GitHub Action for producing Jekyll build artifacts compatible with GitHub Pages.","headline":"Jekyll Actions Demo","name":"Jekyll Actions Demo","url":"https://github.com/pages/actions/jekyll-build-pages/"}</script>
{"url":"https://github.com/pages/actions/jekyll-build-pages/","@type":"WebSite","headline":"Jekyll Actions Demo","name":"Jekyll Actions Demo","@context":"https://schema.org"}</script>
<!-- End Jekyll SEO tag -->
<link rel="stylesheet" href="/pages/actions/jekyll-build-pages/assets/css/style.css?v=JEKYLL_BUILD_REVISION">

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 53 KiB

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 53 KiB

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 54 KiB

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 54 KiB

+5 -8
View File
@@ -5,21 +5,18 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Begin Jekyll SEO tag v2.8.0 -->
<title>themes | A simple GitHub Action for producing Jekyll build artifacts compatible with GitHub Pages.</title>
<meta name="generator" content="Jekyll v3.10.0" />
<!-- Begin Jekyll SEO tag v2.7.1 -->
<title>themes</title>
<meta name="generator" content="Jekyll v3.9.0" />
<meta property="og:title" content="themes" />
<meta property="og:locale" content="en_US" />
<meta name="description" content="A simple GitHub Action for producing Jekyll build artifacts compatible with GitHub Pages." />
<meta property="og:description" content="A simple GitHub Action for producing Jekyll build artifacts compatible with GitHub Pages." />
<link rel="canonical" href="https://github.com/pages/actions/jekyll-build-pages/" />
<meta property="og:url" content="https://github.com/pages/actions/jekyll-build-pages/" />
<meta property="og:site_name" content="themes" />
<meta property="og:type" content="website" />
<meta name="twitter:card" content="summary" />
<meta property="twitter:title" content="themes" />
<script type="application/ld+json">
{"@context":"https://schema.org","@type":"WebSite","description":"A simple GitHub Action for producing Jekyll build artifacts compatible with GitHub Pages.","headline":"themes","name":"themes","url":"https://github.com/pages/actions/jekyll-build-pages/"}</script>
{"url":"https://github.com/pages/actions/jekyll-build-pages/","@type":"WebSite","headline":"themes","name":"themes","@context":"https://schema.org"}</script>
<!-- End Jekyll SEO tag -->
<link rel="stylesheet" href="/pages/actions/jekyll-build-pages/assets/css/style.css?v=JEKYLL_BUILD_REVISION">
@@ -45,7 +42,7 @@
<p>A simple GitHub Action for producing Jekyll build artifacts compatible with GitHub Pages.</p>
<p></p>
<p class="view"><a href="https://github.com/actions/jekyll-build-pages">View the Project on GitHub <small>actions/jekyll-build-pages</small></a></p>