upgraded git pages

This commit is contained in:
Nuno Coração 2022-09-11 22:26:51 +01:00
parent b12c07cd01
commit a661608ed4
4 changed files with 1 additions and 127 deletions

View file

@ -1,34 +0,0 @@
name: GitHub Pages
on:
push:
branches:
- main
jobs:
build-deploy:
name: Build and Deploy
runs-on: ubuntu-20.04
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: "latest"
- name: Build
run: hugo -s exampleSite --themesDir ../.. -d ../docs --baseURL https://nunocoracao.github.io/blowfish/
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: ./docs

View file

@ -1,24 +0,0 @@
[build]
command = "cd exampleSite && hugo --gc --minify -D -b $URL"
publish = "exampleSite/public"
[build.environment]
HUGO_THEMESDIR = "../.."
HUGO_THEME = "repo"
TZ = "Portugal/Lisbon"
[context.production.environment]
HUGO_VERSION = "0.100.2"
HUGO_ENV = "production"
[context.deploy-preview]
command = "cd exampleSite && hugo --gc --minify -D -b $DEPLOY_PRIME_URL"
[context.deploy-preview.environment]
HUGO_VERSION = "0.100.2"
[context.branch-deploy]
command = "cd exampleSite && hugo --gc --minify -D -b $DEPLOY_PRIME_URL"
[context.branch-deploy.environment]
HUGO_VERSION = "0.100.2"

View file

@ -7,7 +7,7 @@
"postinstall": "vendor-copy", "postinstall": "vendor-copy",
"assets": "rimraf assets/vendor && vendor-copy", "assets": "rimraf assets/vendor && vendor-copy",
"dev": "NODE_ENV=development ./node_modules/tailwindcss/lib/cli.js -i ./assets/css/main.css -o ./assets/css/compiled/main.css --jit -w", "dev": "NODE_ENV=development ./node_modules/tailwindcss/lib/cli.js -i ./assets/css/main.css -o ./assets/css/compiled/main.css --jit -w",
"build": "NODE_ENV=production ./node_modules/tailwindcss/lib/cli.js -i ./assets/css/main.css -o ./assets/css/compiled/main.css --jit && hugo --source exampleSite --themesDir ../.. -d docs", "build": "NODE_ENV=production ./node_modules/tailwindcss/lib/cli.js -i ./assets/css/main.css -o ./assets/css/compiled/main.css --jit && hugo -s exampleSite --themesDir ../.. -d ../docs --baseURL https://nunocoracao.github.io/blowfish/",
"example": "hugo server --source exampleSite --themesDir ../.. --buildDrafts -b http://localhost/ -p 1313", "example": "hugo server --source exampleSite --themesDir ../.. --buildDrafts -b http://localhost/ -p 1313",
"lighthouse": "lhci autorun" "lighthouse": "lhci autorun"
}, },

View file

@ -1,68 +0,0 @@
#!bin/bash
# get current branch
branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,')
# push any local changes
git push
# run a build to catch any uncommitted updates
npm run build
# branch validation
if [ $branch = "dev" ]; then
# check current branch is clean
if output=$(git status --porcelain) && [ -z "$output" ]; then
# get the version number
echo "Enter the release version (eg. 1.2.0):"
read version
echo "Started releasing Blowfish v$version..."
# update package version
jq --arg version "$version" '.version=$version' package.json > package.tmp && mv package.tmp package.json
sed -i "" -e "1s/^\(\/\*! Blowfish \)v[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}/\1v$version/" assets/css/main.css
# update changelog
chan release $version || exit
npx prettier --write CHANGELOG.md
# build project
npm run build
# commit version updates
git commit -a -m "🔨 Preparing release v$version"
git push
# switch to stable branch
git checkout stable
# pull latest from stable
git pull
# merge in changes from dev branch
git merge --no-ff dev -m "🔖 Release v$version"
# create tag
git tag "v$version"
# push commit and tag to remote
git push
git push --tags
# publish GitHub release
timeout 2 chan gh-release $version
echo "Blowfish v$version successfully released! 🎉"
echo "Returning to dev branch..."
git checkout dev
else
echo "ERROR: There are unstaged changes in development!"
echo "Clean the working directory and try again."
fi
else
echo "ERROR: Releases can only be published from the dev branch!"
fi