Refactor workflows (#835)
Signed-off-by: hossainemruz <hossainemruz@gmail.com>
This commit is contained in:
parent
e5230e8c93
commit
93fc487111
14 changed files with 4384 additions and 440 deletions
|
@ -1 +1,3 @@
|
|||
node_modules
|
||||
node_modules
|
||||
exampleSite/node_modules
|
||||
exampleSite/public
|
||||
|
|
34
.github/workflows/build.yml
vendored
34
.github/workflows/build.yml
vendored
|
@ -1,34 +0,0 @@
|
|||
name: Run Build
|
||||
|
||||
# Run action on pull request event
|
||||
on: [pull_request]
|
||||
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
# checkout to the commit that has been pushed
|
||||
- uses: actions/checkout@v4.1.1
|
||||
with:
|
||||
submodules: true # Fetch Hugo themes (true OR recursive)
|
||||
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 16
|
||||
|
||||
- name: Install node modules
|
||||
run: npm install
|
||||
|
||||
- name: Setup Hugo
|
||||
uses: peaceiris/actions-hugo@v2.6.0
|
||||
with:
|
||||
hugo-version: 'latest'
|
||||
extended: true
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
cd exampleSite
|
||||
hugo --minify
|
13
.github/workflows/enforce-label.yml
vendored
13
.github/workflows/enforce-label.yml
vendored
|
@ -1,13 +0,0 @@
|
|||
name: Enforce Labels
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [labeled, unlabeled, opened, edited, synchronize]
|
||||
jobs:
|
||||
enforce-label:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: yogevbd/enforce-label-action@2.2.2
|
||||
with:
|
||||
REQUIRED_LABELS_ANY: "automerge,breaking-change,bug-fix,enhancement,feature,translation"
|
||||
REQUIRED_LABELS_ANY_DESCRIPTION: "The PR must have at least one these labels: ['automerge','breaking-change','bug-fix','enhancement','feature','translation']"
|
13
.github/workflows/md-link-checker.yml
vendored
13
.github/workflows/md-link-checker.yml
vendored
|
@ -1,13 +0,0 @@
|
|||
name: Check Markdown links
|
||||
|
||||
# Run action on pull request event
|
||||
on: [pull_request]
|
||||
|
||||
jobs:
|
||||
markdown-link-check:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
# checkout to latest commit
|
||||
- uses: actions/checkout@v4.1.1
|
||||
# run markdown linter
|
||||
- uses: gaurav-nelson/github-action-markdown-link-check@1.0.15
|
|
@ -1,4 +1,4 @@
|
|||
name: Release Drafter
|
||||
name: Merge to main workflows
|
||||
# Run action on push in mater branch
|
||||
on:
|
||||
push:
|
150
.github/workflows/project-automation-issue.yaml
vendored
150
.github/workflows/project-automation-issue.yaml
vendored
|
@ -1,150 +0,0 @@
|
|||
name: Project Automation (Issue)
|
||||
on:
|
||||
issues:
|
||||
types:
|
||||
- opened
|
||||
- reopened
|
||||
- closed
|
||||
- labeled
|
||||
- unlabeled
|
||||
jobs:
|
||||
issue_automation:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Get project data
|
||||
env:
|
||||
GITHUB_TOKEN: ${{secrets.PROJECT_AUTOMATION}}
|
||||
ORGANIZATION: hugo-toha
|
||||
PROJECT_NUMBER: 4
|
||||
run: |
|
||||
gh api graphql --header 'GraphQL-Features: projects_next_graphql' -f query='
|
||||
query($org: String!, $number: Int!) {
|
||||
organization(login: $org){
|
||||
projectNext(number: $number) {
|
||||
id
|
||||
fields(first:20) {
|
||||
nodes {
|
||||
id
|
||||
name
|
||||
settings
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}' -f org="$ORGANIZATION" -F number=$PROJECT_NUMBER > project_data.json
|
||||
|
||||
echo 'PROJECT_ID='$(jq -r '.data.organization.projectNext.id' project_data.json) >> $GITHUB_ENV
|
||||
|
||||
# Read the ID of the "Type" field options
|
||||
echo 'TYPE_ID='$(jq -r '.data.organization.projectNext.fields.nodes[] | select(.name== "Type") |.id' project_data.json) >> $GITHUB_ENV
|
||||
echo 'PROJECT_ID='$(jq -r '.data.organization.projectNext.id' project_data.json) >> $GITHUB_ENV
|
||||
echo 'TYPE_ID='$(jq -r '.data.organization.projectNext.fields.nodes[] | select(.name== "Type") |.id' project_data.json) >> $GITHUB_ENV
|
||||
echo 'TYPE_BUG='$(jq -r '.data.organization.projectNext.fields.nodes[] | select(.name== "Type") |.settings | fromjson.options[] | select(.name=="Bug") |.id' project_data.json) >> $GITHUB_ENV
|
||||
echo 'TYPE_FEATURE='$(jq -r '.data.organization.projectNext.fields.nodes[] | select(.name== "Type") |.settings | fromjson.options[] | select(.name=="Feature") |.id' project_data.json) >> $GITHUB_ENV
|
||||
echo 'TYPE_ENHANCEMENT='$(jq -r '.data.organization.projectNext.fields.nodes[] | select(.name== "Type") |.settings | fromjson.options[] | select(.name=="Enhancement") |.id' project_data.json) >> $GITHUB_ENV
|
||||
echo 'TYPE_DOCUMENTATION='$(jq -r '.data.organization.projectNext.fields.nodes[] | select(.name== "Type") |.settings | fromjson.options[] | select(.name=="Documentation") |.id' project_data.json) >> $GITHUB_ENV
|
||||
echo 'TYPE_TRANSLATION='$(jq -r '.data.organization.projectNext.fields.nodes[] | select(.name== "Type") |.settings | fromjson.options[] | select(.name=="Translation") |.id' project_data.json) >> $GITHUB_ENV
|
||||
|
||||
# Read the id of the "Status" field options
|
||||
echo 'STATUS_ID='$(jq -r '.data.organization.projectNext.fields.nodes[] | select(.name== "Status") |.id' project_data.json) >> $GITHUB_ENV
|
||||
echo 'STATUS_TODO='$(jq -r '.data.organization.projectNext.fields.nodes[] | select(.name== "Status") |.settings | fromjson.options[] | select(.name=="Todo") |.id' project_data.json) >> $GITHUB_ENV
|
||||
echo 'STATUS_IN_PROGRESS='$(jq -r '.data.organization.projectNext.fields.nodes[] | select(.name== "Status") |.settings | fromjson.options[] | select(.name=="In Progress") |.id' project_data.json) >> $GITHUB_ENV
|
||||
echo 'STATUS_READY_FOR_REVIEW='$(jq -r '.data.organization.projectNext.fields.nodes[] | select(.name== "Status") |.settings | fromjson.options[] | select(.name=="Ready for Review") |.id' project_data.json) >> $GITHUB_ENV
|
||||
echo 'STATUS_DONE='$(jq -r '.data.organization.projectNext.fields.nodes[] | select(.name== "Status") |.settings | fromjson.options[] | select(.name=="Done") |.id' project_data.json) >> $GITHUB_ENV
|
||||
|
||||
- name: Add Issue to project
|
||||
env:
|
||||
GITHUB_TOKEN: ${{secrets.PROJECT_AUTOMATION}}
|
||||
ISSUE_ID: ${{ github.event.issue.node_id }}
|
||||
run: |
|
||||
item_id="$( gh api graphql -f query='
|
||||
mutation($project:ID!, $issue:ID!) {
|
||||
addProjectNextItem(input: {projectId: $project, contentId: $issue}) {
|
||||
projectNextItem {
|
||||
id
|
||||
}
|
||||
}
|
||||
}' -f project="$PROJECT_ID" -f issue="$ISSUE_ID" --jq '.data.addProjectNextItem.projectNextItem.id')"
|
||||
|
||||
echo 'ITEM_ID='$item_id >> $GITHUB_ENV
|
||||
|
||||
- name: Export Labels
|
||||
env:
|
||||
ISSUE_DATA: ${{ toJson(github.event.issue) }}
|
||||
run: |
|
||||
echo 'LABELS='$(echo "$ISSUE_DATA" | jq -r '[.labels[].name] | join(" ")') >> $GITHUB_ENV
|
||||
|
||||
- name: Set "Type" field
|
||||
env:
|
||||
GITHUB_TOKEN: ${{secrets.PROJECT_AUTOMATION}}
|
||||
run: |
|
||||
# Only execute this step if the Issue contains at least one label
|
||||
if [ "${#LABELS[@]}" -gt 0 ]; then
|
||||
|
||||
# Let by default the type is "Bug"
|
||||
OPTION_ID=$TYPE_BUG
|
||||
|
||||
# If it has "feature" label then set the type to "Feature"
|
||||
if [[ "${LABELS[*]}" =~ "feature" ]]; then
|
||||
OPTION_ID=$TYPE_FEATURE
|
||||
fi
|
||||
|
||||
# If it has "enhancement" label then set the type to "Enhancement"
|
||||
if [[ "${LABELS[*]}" =~ "enhancement" ]]; then
|
||||
OPTION_ID=$TYPE_ENHANCEMENT
|
||||
fi
|
||||
|
||||
# If it has "documentation" label then set the type to "Documentation"
|
||||
if [[ "${LABELS[*]}" =~ "documentation" ]]; then
|
||||
OPTION_ID=$TYPE_DOCUMENTATION
|
||||
fi
|
||||
|
||||
# If it has "translation" label then set the type to "Translation"
|
||||
if [[ "${LABELS[*]}" =~ "translation" ]]; then
|
||||
OPTION_ID=$TYPE_TRANSLATION
|
||||
fi
|
||||
|
||||
# Set the "Type" field to appropriate option
|
||||
gh api graphql -f query='
|
||||
mutation ($project: ID!, $item: ID!, $field: ID!, $opt_id: String!) {
|
||||
updateProjectNextItemField(input: {
|
||||
projectId: $project
|
||||
itemId: $item
|
||||
fieldId: $field
|
||||
value: $opt_id
|
||||
}) {
|
||||
projectNextItem {
|
||||
id
|
||||
}
|
||||
}
|
||||
}' -f project="$PROJECT_ID" -f item="$ITEM_ID" -f field="$TYPE_ID" -f opt_id="$OPTION_ID" --silent
|
||||
fi
|
||||
|
||||
- name: Set "Status" field
|
||||
env:
|
||||
GITHUB_TOKEN: ${{secrets.PROJECT_AUTOMATION}}
|
||||
run: |
|
||||
STATE=${{github.event.issue.state}}
|
||||
|
||||
echo "State: $STATE"
|
||||
|
||||
OPTION_ID=$STATUS_TODO
|
||||
|
||||
if [[ "${STATE}" == "closed" ]]
|
||||
then
|
||||
OPTION_ID=$STATUS_DONE
|
||||
fi
|
||||
|
||||
gh api graphql -f query='
|
||||
mutation ($project: ID!, $item: ID!, $field: ID!, $status_id: String!) {
|
||||
updateProjectNextItemField(input: {
|
||||
projectId: $project
|
||||
itemId: $item
|
||||
fieldId: $field
|
||||
value: $status_id
|
||||
}) {
|
||||
projectNextItem {
|
||||
id
|
||||
}
|
||||
}
|
||||
}' -f project="$PROJECT_ID" -f item="$ITEM_ID" -f field="$STATUS_ID" -f status_id="$OPTION_ID" --silent
|
219
.github/workflows/project-automation-pr.yaml
vendored
219
.github/workflows/project-automation-pr.yaml
vendored
|
@ -1,219 +0,0 @@
|
|||
name: Project Automation (PR)
|
||||
on:
|
||||
pull_request:
|
||||
types:
|
||||
- opened
|
||||
- ready_for_review
|
||||
- reopened
|
||||
- review_requested
|
||||
- closed
|
||||
- labeled
|
||||
- unlabeled
|
||||
- synchronize
|
||||
jobs:
|
||||
pr_automation:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Get project data
|
||||
env:
|
||||
GITHUB_TOKEN: ${{secrets.PROJECT_AUTOMATION}}
|
||||
ORGANIZATION: hugo-toha
|
||||
PROJECT_NUMBER: 4
|
||||
run: |
|
||||
gh api graphql --header 'GraphQL-Features: projects_next_graphql' -f query='
|
||||
query($org: String!, $number: Int!) {
|
||||
organization(login: $org){
|
||||
projectNext(number: $number) {
|
||||
id
|
||||
fields(first:20) {
|
||||
nodes {
|
||||
id
|
||||
name
|
||||
settings
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}' -f org="$ORGANIZATION" -F number=$PROJECT_NUMBER > project_data.json
|
||||
|
||||
echo 'PROJECT_ID='$(jq -r '.data.organization.projectNext.id' project_data.json) >> $GITHUB_ENV
|
||||
|
||||
# Read the ID of the "Type" field options
|
||||
echo 'TYPE_ID='$(jq -r '.data.organization.projectNext.fields.nodes[] | select(.name== "Type") |.id' project_data.json) >> $GITHUB_ENV
|
||||
echo 'PROJECT_ID='$(jq -r '.data.organization.projectNext.id' project_data.json) >> $GITHUB_ENV
|
||||
echo 'TYPE_ID='$(jq -r '.data.organization.projectNext.fields.nodes[] | select(.name== "Type") |.id' project_data.json) >> $GITHUB_ENV
|
||||
echo 'TYPE_BUG='$(jq -r '.data.organization.projectNext.fields.nodes[] | select(.name== "Type") |.settings | fromjson.options[] | select(.name=="Bug") |.id' project_data.json) >> $GITHUB_ENV
|
||||
echo 'TYPE_FEATURE='$(jq -r '.data.organization.projectNext.fields.nodes[] | select(.name== "Type") |.settings | fromjson.options[] | select(.name=="Feature") |.id' project_data.json) >> $GITHUB_ENV
|
||||
echo 'TYPE_ENHANCEMENT='$(jq -r '.data.organization.projectNext.fields.nodes[] | select(.name== "Type") |.settings | fromjson.options[] | select(.name=="Enhancement") |.id' project_data.json) >> $GITHUB_ENV
|
||||
echo 'TYPE_DOCUMENTATION='$(jq -r '.data.organization.projectNext.fields.nodes[] | select(.name== "Type") |.settings | fromjson.options[] | select(.name=="Documentation") |.id' project_data.json) >> $GITHUB_ENV
|
||||
echo 'TYPE_TRANSLATION='$(jq -r '.data.organization.projectNext.fields.nodes[] | select(.name== "Type") |.settings | fromjson.options[] | select(.name=="Translation") |.id' project_data.json) >> $GITHUB_ENV
|
||||
|
||||
# Read the id of the "Status" field options
|
||||
echo 'STATUS_ID='$(jq -r '.data.organization.projectNext.fields.nodes[] | select(.name== "Status") |.id' project_data.json) >> $GITHUB_ENV
|
||||
echo 'STATUS_TODO='$(jq -r '.data.organization.projectNext.fields.nodes[] | select(.name== "Status") |.settings | fromjson.options[] | select(.name=="Todo") |.id' project_data.json) >> $GITHUB_ENV
|
||||
echo 'STATUS_IN_PROGRESS='$(jq -r '.data.organization.projectNext.fields.nodes[] | select(.name== "Status") |.settings | fromjson.options[] | select(.name=="In Progress") |.id' project_data.json) >> $GITHUB_ENV
|
||||
echo 'STATUS_READY_FOR_REVIEW='$(jq -r '.data.organization.projectNext.fields.nodes[] | select(.name== "Status") |.settings | fromjson.options[] | select(.name=="Ready for Review") |.id' project_data.json) >> $GITHUB_ENV
|
||||
echo 'STATUS_DONE='$(jq -r '.data.organization.projectNext.fields.nodes[] | select(.name== "Status") |.settings | fromjson.options[] | select(.name=="Done") |.id' project_data.json) >> $GITHUB_ENV
|
||||
|
||||
- name: Add PR to project
|
||||
env:
|
||||
GITHUB_TOKEN: ${{secrets.PROJECT_AUTOMATION}}
|
||||
PR_ID: ${{ github.event.pull_request.node_id }}
|
||||
run: |
|
||||
item_id="$( gh api graphql -f query='
|
||||
mutation($project:ID!, $pr:ID!) {
|
||||
addProjectNextItem(input: {projectId: $project, contentId: $pr}) {
|
||||
projectNextItem {
|
||||
id
|
||||
}
|
||||
}
|
||||
}' -f project="$PROJECT_ID" -f pr="$PR_ID" --jq '.data.addProjectNextItem.projectNextItem.id')"
|
||||
|
||||
echo 'ITEM_ID='$item_id >> $GITHUB_ENV
|
||||
|
||||
- name: Export Labels
|
||||
env:
|
||||
PR_DATA: ${{ toJson(github.event.pull_request) }}
|
||||
run: |
|
||||
echo 'LABELS='$(echo "$PR_DATA" | jq -r '[.labels[].name] | join(" ")') >> $GITHUB_ENV
|
||||
|
||||
- name: Set "Type" field
|
||||
env:
|
||||
GITHUB_TOKEN: ${{secrets.PROJECT_AUTOMATION}}
|
||||
run: |
|
||||
# Only execute this step if the PR contains at least one label
|
||||
if [ "${#LABELS[@]}" -gt 0 ]; then
|
||||
|
||||
# Let by default the type is "Bug"
|
||||
OPTION_ID=$TYPE_BUG
|
||||
|
||||
# If it has "feature" label then set the type to "Feature"
|
||||
if [[ "${LABELS[*]}" =~ "feature" ]]; then
|
||||
OPTION_ID=$TYPE_FEATURE
|
||||
fi
|
||||
|
||||
# If it has "enhancement" label then set the type to "Enhancement"
|
||||
if [[ "${LABELS[*]}" =~ "enhancement" ]]; then
|
||||
OPTION_ID=$TYPE_ENHANCEMENT
|
||||
fi
|
||||
|
||||
# If it has "documentation" label then set the type to "Documentation"
|
||||
if [[ "${LABELS[*]}" =~ "documentation" ]]; then
|
||||
OPTION_ID=$TYPE_DOCUMENTATION
|
||||
fi
|
||||
|
||||
# If it has "translation" label then set the type to "Translation"
|
||||
if [[ "${LABELS[*]}" =~ "translation" ]]; then
|
||||
OPTION_ID=$TYPE_TRANSLATION
|
||||
fi
|
||||
|
||||
# Set the "Type" field to appropriate option
|
||||
gh api graphql -f query='
|
||||
mutation ($project: ID!, $item: ID!, $field: ID!, $opt_id: String!) {
|
||||
updateProjectNextItemField(input: {
|
||||
projectId: $project
|
||||
itemId: $item
|
||||
fieldId: $field
|
||||
value: $opt_id
|
||||
}) {
|
||||
projectNextItem {
|
||||
id
|
||||
}
|
||||
}
|
||||
}' -f project="$PROJECT_ID" -f item="$ITEM_ID" -f field="$TYPE_ID" -f opt_id="$OPTION_ID" --silent
|
||||
fi
|
||||
|
||||
- name: Set "Status" field
|
||||
env:
|
||||
GITHUB_TOKEN: ${{secrets.PROJECT_AUTOMATION}}
|
||||
run: |
|
||||
MERGED=${{github.event.pull_request.merged}}
|
||||
STATE=${{github.event.pull_request.state}}
|
||||
REVIEWERS=${{github.event.pull_request.requested_reviewers}}
|
||||
DRAFT=${{github.event.pull_request.draft}}
|
||||
|
||||
echo "Merged: $MERGED"
|
||||
echo "State: $STATE"
|
||||
echo "Draft: $DRAFT"
|
||||
echo "Reviewer: $REVIEWER"
|
||||
|
||||
OPTION_ID=$STATUS_TODO
|
||||
|
||||
if [[ ("${MERGED}" == "true") || ("${STATE}" == "closed") ]]
|
||||
then
|
||||
OPTION_ID=$STATUS_DONE
|
||||
elif [[ ${#REVIEWERS[@]} -gt 0 ]]
|
||||
then
|
||||
OPTION_ID=$STATUS_READY_FOR_REVIEW
|
||||
else
|
||||
OPTION_ID=$STATUS_IN_PROGRESS
|
||||
fi
|
||||
|
||||
# Expose the OPTION_ID so that it can be used in later steps
|
||||
echo 'PR_STATUS='$OPTION_ID >> $GITHUB_ENV
|
||||
|
||||
gh api graphql -f query='
|
||||
mutation ($project: ID!, $item: ID!, $field: ID!, $status_id: String!) {
|
||||
updateProjectNextItemField(input: {
|
||||
projectId: $project
|
||||
itemId: $item
|
||||
fieldId: $field
|
||||
value: $status_id
|
||||
}) {
|
||||
projectNextItem {
|
||||
id
|
||||
}
|
||||
}
|
||||
}' -f project="$PROJECT_ID" -f item="$ITEM_ID" -f field="$STATUS_ID" -f status_id="$OPTION_ID" --silent
|
||||
|
||||
- name: Find Linked Issues
|
||||
id: linked_issues
|
||||
uses: hossainemruz/linked-issues@main
|
||||
with:
|
||||
pr_url: ${{github.event.pull_request.html_url}}
|
||||
format: IssueNumber
|
||||
|
||||
- name: Update Linked Issues Status
|
||||
env:
|
||||
GITHUB_TOKEN: ${{secrets.PROJECT_AUTOMATION}}
|
||||
run: |
|
||||
declare -a issues=(${{ steps.linked_issues.outputs.issues }})
|
||||
|
||||
# Loop through the every issues and update their Status to same as the PR Status
|
||||
for i in "${issues[@]}"
|
||||
do
|
||||
# Find the Issue ID
|
||||
ISSUE_ID="$(gh api graphql -f query='
|
||||
query($owner: String!, $name: String!, $issue_number: Int!) {
|
||||
repository(owner: $owner, name: $name) {
|
||||
issue(number: $issue_number) {
|
||||
id
|
||||
}
|
||||
}
|
||||
}' -f owner="${{github.event.pull_request.head.repo.owner.login}}" -f name="${{github.event.pull_request.head.repo.name}}" -F issue_number=$i --jq='.data.repository.issue.id')"
|
||||
|
||||
# Find the id of the Issue at the project board
|
||||
item_id="$( gh api graphql -f query='
|
||||
mutation($project:ID!, $pr:ID!) {
|
||||
addProjectNextItem(input: {projectId: $project, contentId: $pr}) {
|
||||
projectNextItem {
|
||||
id
|
||||
}
|
||||
}
|
||||
}' -f project="$PROJECT_ID" -f pr="$ISSUE_ID" --jq '.data.addProjectNextItem.projectNextItem.id')"
|
||||
|
||||
# Update the Issue Status
|
||||
gh api graphql -f query='
|
||||
mutation ($project: ID!, $item: ID!, $field: ID!, $status_id: String!) {
|
||||
updateProjectNextItemField(input: {
|
||||
projectId: $project
|
||||
itemId: $item
|
||||
fieldId: $field
|
||||
value: $status_id
|
||||
}) {
|
||||
projectNextItem {
|
||||
id
|
||||
}
|
||||
}
|
||||
}' -f project="$PROJECT_ID" -f item="$item_id" -f field="$STATUS_ID" -f status_id="$PR_STATUS" --silent
|
||||
done
|
68
.github/workflows/pull-request.yml
vendored
Normal file
68
.github/workflows/pull-request.yml
vendored
Normal file
|
@ -0,0 +1,68 @@
|
|||
name: PR Workflows
|
||||
|
||||
# Run action on pull request event
|
||||
on: [pull_request]
|
||||
|
||||
|
||||
jobs:
|
||||
# Build exampleSite
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
# checkout to the commit that has been pushed
|
||||
- uses: actions/checkout@v4.1.1
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18
|
||||
|
||||
- name: Install node modules
|
||||
run: npm install
|
||||
|
||||
- name: Setup Hugo
|
||||
uses: peaceiris/actions-hugo@v2.6.0
|
||||
with:
|
||||
hugo-version: 'latest'
|
||||
extended: true
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
cd exampleSite
|
||||
hugo --minify
|
||||
|
||||
# Run linter
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4.1.1
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18
|
||||
|
||||
- name: Install node modules
|
||||
run: npm install
|
||||
|
||||
- name: Lint
|
||||
run: |
|
||||
npm run lint
|
||||
|
||||
# Ensure that PR has desired labels
|
||||
enforce-label:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: yogevbd/enforce-label-action@2.2.2
|
||||
with:
|
||||
REQUIRED_LABELS_ANY: "automerge,breaking-change,bug-fix,enhancement,feature,translation"
|
||||
REQUIRED_LABELS_ANY_DESCRIPTION: "The PR must have at least one these labels: ['automerge','breaking-change','bug-fix','enhancement','feature','translation']"
|
||||
|
||||
# Check for any broken links
|
||||
markdown-link-check:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
# checkout to latest commit
|
||||
- uses: actions/checkout@v4.1.1
|
||||
# run markdown linter
|
||||
- uses: gaurav-nelson/github-action-markdown-link-check@1.0.15
|
|
@ -24,7 +24,7 @@ function toggleCourseVisibility (elem) {
|
|||
window.addEventListener('DOMContentLoaded', () => {
|
||||
const els = Array.from(document.getElementsByClassName('btn'));
|
||||
|
||||
els.filter((el) => el != null && (el.id == 'show-more-btn' || el.id == 'show-less-btn')).forEach((el) =>
|
||||
els.filter((el) => el != null && (el.id === 'show-more-btn' || el.id === 'show-less-btn')).forEach((el) =>
|
||||
el.addEventListener('click', ({ target }) =>
|
||||
toggleCourseVisibility(target)))
|
||||
})
|
||||
|
|
|
@ -5,6 +5,7 @@ title: Example Site
|
|||
|
||||
module:
|
||||
imports:
|
||||
- path: github.com/hugo-toha/toha/v4
|
||||
- path: github.com/hugo-toha/hugo-toha.github.io
|
||||
disable: false
|
||||
mounts:
|
||||
|
@ -18,7 +19,15 @@ module:
|
|||
target: assets
|
||||
- source: static
|
||||
target: static
|
||||
- path: github.com/hugo-toha/toha/v4
|
||||
mounts:
|
||||
- source: static/files
|
||||
target: static/files
|
||||
- source: ./node_modules/flag-icon-css/flags
|
||||
target: static/flags
|
||||
- source: ./node_modules/@fontsource/mulish/files
|
||||
target: static/files
|
||||
- source: ./node_modules/katex/dist/fonts
|
||||
target: static/fonts
|
||||
|
||||
# Manage languages
|
||||
# For any more details, you can check the official documentation: https://gohugo.io/content-management/multilingual/
|
||||
|
@ -80,7 +89,7 @@ params:
|
|||
|
||||
# Enable dark theme
|
||||
darkMode:
|
||||
enable: false
|
||||
enable: true
|
||||
|
||||
# Enable and configure portfolio
|
||||
portfolio:
|
||||
|
@ -208,7 +217,7 @@ params:
|
|||
|
||||
# Enable this to create mathematic expressions using `$$` blocks
|
||||
math:
|
||||
enable: false
|
||||
enable: true
|
||||
services:
|
||||
# https://katex.org/docs/autorender.html#api for more configurations
|
||||
katex:
|
||||
|
|
|
@ -2,7 +2,9 @@ module github.com/hugo-toha/toha/exampleSite
|
|||
|
||||
go 1.19
|
||||
|
||||
require github.com/hugo-toha/hugo-toha.github.io v0.0.0-20221228191121-007f31838bd6 // indirect
|
||||
require (
|
||||
github.com/hugo-toha/hugo-toha.github.io v0.0.0-20231031082630-2c32a26d2207 // indirect
|
||||
github.com/hugo-toha/toha/v4 v4.0.0-20231113175302-e5230e8c93d8 // indirect
|
||||
)
|
||||
|
||||
replace github.com/hugo-toha/toha/v4 => ../../toha
|
||||
// replace github.com/hugo-toha/hugo-toha.github.io => ../../hugo-toha.github.io
|
||||
|
|
|
@ -1,2 +1,4 @@
|
|||
github.com/hugo-toha/hugo-toha.github.io v0.0.0-20221228191121-007f31838bd6 h1:TPFhOZAnuH4wjLIdzimswCRa2qCcc1teKVTatADJU2g=
|
||||
github.com/hugo-toha/hugo-toha.github.io v0.0.0-20221228191121-007f31838bd6/go.mod h1:OMMaP9Hh9NsKd41lVIazBQRPa0s6Z57AfJoY3DcCNNY=
|
||||
github.com/hugo-toha/hugo-toha.github.io v0.0.0-20231031082630-2c32a26d2207 h1:T71lEaGpHYpdy8yKM5vaVwm+CJGt8wjHvPgVM+GjCJM=
|
||||
github.com/hugo-toha/hugo-toha.github.io v0.0.0-20231031082630-2c32a26d2207/go.mod h1:aTn1lQX1rbcbfbwNuWHG/L5DPtD+bEzQro49QyFlbEg=
|
||||
|
|
4238
exampleSite/package-lock.json
generated
4238
exampleSite/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -1,10 +1,64 @@
|
|||
{
|
||||
"comments": {
|
||||
"dependencies": {},
|
||||
"devDependencies": {}
|
||||
"devDependencies": {
|
||||
"@fontsource/mulish": "github.com/hugo-toha/toha/v4",
|
||||
"@fortawesome/fontawesome-free": "github.com/hugo-toha/toha/v4",
|
||||
"autoprefixer": "github.com/hugo-toha/toha/v4",
|
||||
"bootstrap": "github.com/hugo-toha/toha/v4",
|
||||
"eslint": "github.com/hugo-toha/toha/v4",
|
||||
"eslint-config-prettier": "github.com/hugo-toha/toha/v4",
|
||||
"eslint-config-standard": "github.com/hugo-toha/toha/v4",
|
||||
"eslint-plugin-import": "github.com/hugo-toha/toha/v4",
|
||||
"eslint-plugin-n": "github.com/hugo-toha/toha/v4",
|
||||
"eslint-plugin-no-jquery": "github.com/hugo-toha/toha/v4",
|
||||
"eslint-plugin-promise": "github.com/hugo-toha/toha/v4",
|
||||
"feather-icons": "github.com/hugo-toha/toha/v4",
|
||||
"filterizr": "github.com/hugo-toha/toha/v4",
|
||||
"flag-icon-css": "github.com/hugo-toha/toha/v4",
|
||||
"fuse.js": "github.com/hugo-toha/toha/v4",
|
||||
"highlight.js": "github.com/hugo-toha/toha/v4",
|
||||
"imagesloaded": "github.com/hugo-toha/toha/v4",
|
||||
"include-media": "github.com/hugo-toha/toha/v4",
|
||||
"ityped": "github.com/hugo-toha/toha/v4",
|
||||
"katex": "github.com/hugo-toha/toha/v4",
|
||||
"mark.js": "github.com/hugo-toha/toha/v4",
|
||||
"mermaid": "github.com/hugo-toha/toha/v4",
|
||||
"plyr": "github.com/hugo-toha/toha/v4",
|
||||
"popper.js": "github.com/hugo-toha/toha/v4",
|
||||
"postcss": "github.com/hugo-toha/toha/v4",
|
||||
"postcss-cli": "github.com/hugo-toha/toha/v4"
|
||||
}
|
||||
},
|
||||
"dependencies": {},
|
||||
"devDependencies": {},
|
||||
"devDependencies": {
|
||||
"@fontsource/mulish": "4.5.13",
|
||||
"@fortawesome/fontawesome-free": "^6.2.0",
|
||||
"autoprefixer": "^10.4.13",
|
||||
"bootstrap": "^4.6.2",
|
||||
"eslint": "^8.31.0",
|
||||
"eslint-config-prettier": "^8.6.0",
|
||||
"eslint-config-standard": "^17.0.0",
|
||||
"eslint-plugin-import": "^2.26.0",
|
||||
"eslint-plugin-n": "^15.6.0",
|
||||
"eslint-plugin-no-jquery": "^2.7.0",
|
||||
"eslint-plugin-promise": "^6.1.1",
|
||||
"feather-icons": "^4.29.1",
|
||||
"filterizr": "^2.2.4",
|
||||
"flag-icon-css": "^4.1.7",
|
||||
"fuse.js": "^6.6.2",
|
||||
"highlight.js": "^11.6.0",
|
||||
"imagesloaded": "^5.0.0",
|
||||
"include-media": "^1.4.10",
|
||||
"ityped": "^1.0.3",
|
||||
"katex": "^0.16.3",
|
||||
"mark.js": "^8.11.1",
|
||||
"mermaid": "^9.2.1",
|
||||
"plyr": "^3.7.2",
|
||||
"popper.js": "^1.16.1",
|
||||
"postcss": "^8.4.21",
|
||||
"postcss-cli": "^8.3.1"
|
||||
},
|
||||
"name": "exampleSite",
|
||||
"version": "0.1.0"
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue