fix: update branch name #1
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
# WARNING: If you modify this workflow, please update the documentation | |
on: | |
workflow_call: | |
inputs: | |
earthfile: | |
description: | | |
The path to the folder containing the Earthfile that will be built. | |
This path should be relative to the repository root. | |
required: true | |
type: string | |
target: | |
description: | | |
The target that will be used to build docs. The target should always | |
produce one artifact which is the static site that will be deployed to | |
GitHub Pages. | |
required: false | |
type: string | |
default: docs | |
aws_role_arn: | |
description: | | |
The ARN of the AWS role that will be assumed by the workflow. Only | |
required when configuring a remote Earthly runner. | |
required: false | |
type: string | |
aws_region: | |
description: | | |
The AWS region that will be used by the workflow. Only required when | |
configuring a remote Earthly runner. | |
required: false | |
type: string | |
ci_cli_version: | |
description: | | |
The version of the CI CLI to use. | |
required: false | |
type: string | |
default: latest | |
earthly_version: | |
description: The version of Earthly to use. | |
required: false | |
type: string | |
default: latest | |
secrets: | |
earthly_runner_address: | |
description: | | |
The address of the Earthly runner that will be used to build the | |
Earthfile. | |
required: false | |
earthly_runner_secret: | |
description: | | |
The ID of the AWS secret holding Earthly remote runner credentials. | |
This secret must contain the runner address and the necessary TLS | |
certificates required to authenticate with it. If omitted, a remote | |
Earthly runner will not be configured. | |
required: false | |
jobs: | |
run: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set env | |
run: | | |
GIT_BRANCH=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} | |
if [[ $GIT_BRANCH == "${{ github.event.repository.default_branch }}" ]]; then | |
DEST_DIR="/" | |
CLEAN_EXCLUDE="/branch/*" | |
else | |
DEST_DIR="/branch/${GIT_BRANCH//[^a-zA-Z0-9_]/_}" | |
CLEAN_EXCLUDE="/nothing" | |
fi | |
echo "GIT_BRANCH=$GIT_BRANCH" >> $GITHUB_ENV | |
echo "DEST_DIR=$DEST_DIR" >> $GITHUB_ENV | |
echo "CLEAN_EXCLUDE=$CLEAN_EXCLUDE" >> $GITHUB_ENV | |
- name: Setup CI | |
uses: input-output-hk/catalyst-ci/actions/setup@@feat/udcmigration | |
with: | |
aws_role_arn: ${{ inputs.aws_role_arn }} | |
aws_region: ${{ inputs.aws_region }} | |
cli_version: ${{ inputs.ci_cli_version }} | |
earthly_version: ${{ inputs.earthly_version }} | |
earthly_runner_secret: ${{ secrets.earthly_runner_secret }} | |
- name: Build docs | |
uses: input-output-hk/catalyst-ci/actions/run@@feat/udcmigration | |
id: build | |
with: | |
earthfile: ${{ inputs.earthfile }} | |
targets: ${{ inputs.target }} | |
runner_address: ${{ secrets.earthly_runner_address }} | |
artifact: "true" | |
- name: Publish docs | |
uses: JamesIves/[email protected] | |
with: | |
clean: true | |
clean-exclude: | | |
${{ env.CLEAN_EXCLUDE }} | |
single-commit: true | |
target-folder: ${{ env.DEST_DIR }} | |
branch: ${{ inputs.publish_branch }} | |
folder: ${{ steps.build.outputs.artifact }} |