-
Notifications
You must be signed in to change notification settings - Fork 390
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #157 from deining/gh-action
- Loading branch information
Showing
12 changed files
with
177 additions
and
99 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Fresh to vercel PR deployment | ||
|
||
on: | ||
workflow_run: | ||
workflows: [Fresh to vercel PR] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
createExampleAndDeployToArtifacts: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Download hugo build | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: hugo-output | ||
path: public/ | ||
|
||
- name: Download alias-domain | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: alias-domain | ||
path: alias-domain | ||
|
||
- name: Extract alias-domain | ||
id: extract-alias-domain | ||
run: | | ||
aliasDomain=`cat alias-domain/alias-domain` | ||
echo "ALIAS_DOMAIN=$aliasDomain" >> $GITHUB_OUTPUT | ||
- name: Deploy to Vercel on PR | ||
uses: amondnet/vercel-action@v25 | ||
with: | ||
vercel-token: ${{ secrets.VERCEL_TOKEN }} | ||
vercel-org-id: ${{ secrets.VERCEL_ORG_ID}} | ||
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID}} | ||
alias-domains: ${{ steps.extract-alias-domain.outputs.ALIAS_DOMAIN }}" | ||
working-directory: ./public |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Fresh to vercel PR | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
createExampleAndDeployToArtifacts: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Hugo | ||
uses: peaceiris/actions-hugo@v2 | ||
with: | ||
hugo-version: '0.110.0' | ||
extended: true | ||
|
||
- name: Build with Hugo on PR | ||
working-directory: exampleSite | ||
run: | | ||
git clone https://github.com/StefMa/hugo-fresh themes/hugo-fresh | ||
cd themes/hugo-fresh | ||
git fetch origin ${{ github.ref }}:pr-branch-name | ||
git checkout pr-branch-name | ||
cd ../.. | ||
hugo \ | ||
--minify \ | ||
--baseURL https://hugo-fresh-${{ github.run_number }}.vercel.app | ||
- name: Save hugo as artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: hugo-output | ||
path: exampleSite/public/ | ||
|
||
- name: Save alias domain | ||
run: | | ||
mkdir -p ./alias-domain | ||
echo https://hugo-fresh-${{ github.run_number }}.vercel.app > ./alias-domain/alias-domain | ||
- name: Save alias domain as artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: alias-domain | ||
path: alias-domain/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Fresh to vercel | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
deployMasterToVercel: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Hugo | ||
uses: peaceiris/actions-hugo@v2 | ||
with: | ||
hugo-version: '0.110.0' | ||
extended: true | ||
|
||
- name: Build with Hugo on master | ||
working-directory: exampleSite | ||
run: | | ||
git clone https://github.com/StefMa/hugo-fresh themes/hugo-fresh | ||
hugo \ | ||
--minify \ | ||
--baseURL https://hugo-fresh.vercel.app/ | ||
- name: Deploy to Vercel on master | ||
uses: amondnet/vercel-action@v25 | ||
with: | ||
vercel-token: ${{ secrets.VERCEL_TOKEN }} | ||
vercel-org-id: ${{ secrets.VERCEL_ORG_ID}} | ||
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID}} | ||
vercel-args: '--prod' | ||
working-directory: ./exampleSite/public |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# .github/workflows/htmltest.yml | ||
# Run htmltest link checker on generated HTML output from user guide | ||
|
||
name: Link check with htmltest | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
htmltest: | ||
runs-on: ubuntu-latest | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod | ||
|
||
- name: Set up Hugo | ||
uses: peaceiris/actions-hugo@v2 | ||
with: | ||
hugo-version: "latest" | ||
extended: true | ||
|
||
- run: hugo --destination $GITHUB_WORKSPACE/exampleSite/public --themesDir ../../ --theme hugo-fresh | ||
working-directory: exampleSite | ||
|
||
- name: Test HTML | ||
# https://github.com/wjdp/htmltest-action/ | ||
continue-on-error: true # <- Set to true if run shouldn't fail with broken links | ||
uses: wjdp/htmltest-action@master | ||
with: | ||
# For consistency, use the same config file as for local builds | ||
config: exampleSite/.htmltest.yml | ||
path: exampleSite/public | ||
|
||
- name: Archive htmltest results | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: htmltest-report | ||
path: tmp/.htmltest/htmltest.log | ||
retention-days: 7 # default is 90 days |
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
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
DirectoryPath: public |
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{{ "<!-- Layout with no content to avoid WARN message about missing page layout -->" | safeHTML }} |
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