Initial check-in after refactoring to use Hugo site generator with ReLearn template. HTTP Status Codes page not done--nor adwords added.
This commit is contained in:
14
themes/relearn/.github/actions/build_site/action.yaml
vendored
Normal file
14
themes/relearn/.github/actions/build_site/action.yaml
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
name: Build site
|
||||
description: Builds the Hugo exampleSite for later deploy on GitHub-Pages
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Setup Hugo
|
||||
uses: peaceiris/actions-hugo@v2
|
||||
with:
|
||||
hugo-version: 'latest'
|
||||
|
||||
- name: Build site
|
||||
shell: bash
|
||||
run: |
|
||||
hugo --source ${GITHUB_WORKSPACE}/exampleSite --destination ${GITHUB_WORKSPACE}/../public --cleanDestinationDir --gc --baseURL https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/ --theme ${GITHUB_WORKSPACE}
|
||||
73
themes/relearn/.github/actions/check_milestone/action.yaml
vendored
Normal file
73
themes/relearn/.github/actions/check_milestone/action.yaml
vendored
Normal file
@ -0,0 +1,73 @@
|
||||
name: Check milestone
|
||||
description: Checks if the given milestone and its according tag are valid to be released
|
||||
inputs:
|
||||
milestone:
|
||||
description: Milestone for this release
|
||||
required: true
|
||||
github_token:
|
||||
description: Secret GitHub token
|
||||
required: true
|
||||
outputs:
|
||||
outcome:
|
||||
description: Result of the check, success or failure
|
||||
value: ${{ steps.outcome.outputs.outcome }}
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Get tag uniqueness
|
||||
id: unique_tag
|
||||
uses: mukunku/tag-exists-action@v1.0.0
|
||||
with:
|
||||
tag: ${{ env.MILESTONE }}
|
||||
env:
|
||||
MILESTONE: ${{ inputs.milestone }}
|
||||
GITHUB_TOKEN: ${{ inputs.github_token }}
|
||||
|
||||
- name: Get closed issues for milestone
|
||||
id: closed_issues
|
||||
uses: octokit/graphql-action@v2.x
|
||||
with:
|
||||
query: |
|
||||
query {
|
||||
search(first: 1, type: ISSUE, query: "user:${{ github.repository_owner }} repo:${{ github.event.repository.name }} milestone:${{ env.MILESTONE }} state:closed") {
|
||||
issueCount
|
||||
}
|
||||
}
|
||||
env:
|
||||
MILESTONE: ${{ inputs.milestone }}
|
||||
GITHUB_TOKEN: ${{ inputs.github_token }}
|
||||
|
||||
- name: Get open issues for milestone
|
||||
id: open_issues
|
||||
uses: octokit/graphql-action@v2.x
|
||||
with:
|
||||
query: |
|
||||
query {
|
||||
search(first: 1, type: ISSUE, query: "user:${{ github.repository_owner }} repo:${{ github.event.repository.name }} milestone:${{ env.MILESTONE }} state:open") {
|
||||
issueCount
|
||||
}
|
||||
}
|
||||
env:
|
||||
MILESTONE: ${{ inputs.milestone }}
|
||||
GITHUB_TOKEN: ${{ inputs.github_token }}
|
||||
|
||||
- name: Set outcome
|
||||
id: outcome
|
||||
shell: bash
|
||||
run: |
|
||||
if [ "${{ fromJSON(steps.closed_issues.outputs.data).search.issueCount > 0 && fromJSON(steps.open_issues.outputs.data).search.issueCount == 0 && steps.unique_tag.outputs.exists == 'false' }}" = "true" ]; then
|
||||
echo "::set-output name=outcome::success"
|
||||
else
|
||||
echo "::set-output name=outcome::failure"
|
||||
fi
|
||||
|
||||
- name: Log results and exit
|
||||
shell: bash
|
||||
run: |
|
||||
echo outcome : ${{ steps.outcome.outputs.outcome }}
|
||||
echo has unique tag : ${{ steps.unique_tag.outputs.exists == 'false' }}
|
||||
echo has closed issues: ${{ fromJSON(steps.closed_issues.outputs.data).search.issueCount > 0 }}
|
||||
echo has open issues : ${{ fromJSON(steps.open_issues.outputs.data).search.issueCount > 0 }}
|
||||
if [ "${{ steps.outcome.outputs.outcome }}" = "failure" ]; then
|
||||
exit 1
|
||||
fi
|
||||
17
themes/relearn/.github/actions/deploy_site/action.yaml
vendored
Normal file
17
themes/relearn/.github/actions/deploy_site/action.yaml
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
name: Deploy site
|
||||
description: Deploys a built site on GitHub-Pages
|
||||
inputs:
|
||||
github_token:
|
||||
description: Secret GitHub token
|
||||
required: true
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Deploy site
|
||||
uses: peaceiris/actions-gh-pages@v3
|
||||
with:
|
||||
github_token: ${{ env.GITHUB_TOKEN }}
|
||||
publish_dir: ${{ env.GITHUB_WORKSPACE }}/../public
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ inputs.github_token }}
|
||||
GITHUB_WORKSPACE: ${{ github.workspace }}
|
||||
77
themes/relearn/.github/actions/release_milestone/action.yaml
vendored
Normal file
77
themes/relearn/.github/actions/release_milestone/action.yaml
vendored
Normal file
@ -0,0 +1,77 @@
|
||||
name: Release milestone
|
||||
description: Creates a release with changelog and tag out of a given milestone
|
||||
inputs:
|
||||
milestone:
|
||||
description: Milestone for this release
|
||||
required: true
|
||||
github_token:
|
||||
description: Secret GitHub token
|
||||
required: true
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: '16'
|
||||
|
||||
- name: Close milestone
|
||||
uses: Akkjon/close-milestone@v2
|
||||
with:
|
||||
milestone_name: ${{ env.MILESTONE }}
|
||||
env:
|
||||
MILESTONE: ${{ inputs.milestone }}
|
||||
GITHUB_TOKEN: ${{ inputs.github_token }}
|
||||
|
||||
- name: Create provisionary tag
|
||||
shell: bash
|
||||
env:
|
||||
MILESTONE: ${{ inputs.milestone }}
|
||||
GITHUB_TOKEN: ${{ inputs.github_token }}
|
||||
run: |
|
||||
git config user.name "GitHub Actions Bot"
|
||||
git config user.email "<>"
|
||||
git tag --message "" "$MILESTONE"
|
||||
git push origin "$MILESTONE"
|
||||
|
||||
- name: Update changelog
|
||||
shell: bash
|
||||
env:
|
||||
MILESTONE: ${{ inputs.milestone }}
|
||||
GITHUB_TOKEN: ${{ inputs.github_token }}
|
||||
GREN_GITHUB_TOKEN: ${{ inputs.github_token }}
|
||||
run: |
|
||||
echo "$MILESTONE" > layouts/partials/version.html
|
||||
npx github-release-notes@0.17.1 changelog --generate --override --tags=all
|
||||
git add *
|
||||
git commit --message "Ship tag $MILESTONE"
|
||||
git push origin main
|
||||
|
||||
- name: Create final tag
|
||||
shell: bash
|
||||
env:
|
||||
MILESTONE: ${{ inputs.milestone }}
|
||||
GITHUB_TOKEN: ${{ inputs.github_token }}
|
||||
run: |
|
||||
git tag --force --message "" "$MILESTONE"
|
||||
git push --force origin "$MILESTONE"
|
||||
|
||||
- name: Publish release
|
||||
shell: bash
|
||||
env:
|
||||
MILESTONE: ${{ inputs.milestone }}
|
||||
GREN_GITHUB_TOKEN: ${{ inputs.github_token }}
|
||||
run: |
|
||||
npx github-release-notes@0.17.1 release --tags "$MILESTONE"
|
||||
|
||||
- name: Update version number to mark non-release version
|
||||
shell: bash
|
||||
env:
|
||||
MILESTONE: ${{ inputs.milestone }}
|
||||
GITHUB_TOKEN: ${{ inputs.github_token }}
|
||||
GREN_GITHUB_TOKEN: ${{ inputs.github_token }}
|
||||
run: |
|
||||
echo "$MILESTONE+tip" > layouts/partials/version.html
|
||||
git add *
|
||||
git commit --message "Mark non-release version"
|
||||
git push origin main
|
||||
Reference in New Issue
Block a user