From a661608ed4050b4f3d83ad2259075defa1591c6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nuno=20Cora=C3=A7=C3=A3o?= Date: Sun, 11 Sep 2022 22:26:51 +0100 Subject: [PATCH] upgraded git pages --- .github/workflows/docs-gh-pages.yml | 34 --------------- netlify.toml | 24 ---------- package.json | 2 +- release.sh | 68 ----------------------------- 4 files changed, 1 insertion(+), 127 deletions(-) delete mode 100644 .github/workflows/docs-gh-pages.yml delete mode 100644 netlify.toml delete mode 100755 release.sh diff --git a/.github/workflows/docs-gh-pages.yml b/.github/workflows/docs-gh-pages.yml deleted file mode 100644 index 29bce80f..00000000 --- a/.github/workflows/docs-gh-pages.yml +++ /dev/null @@ -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 diff --git a/netlify.toml b/netlify.toml deleted file mode 100644 index cc2334b4..00000000 --- a/netlify.toml +++ /dev/null @@ -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" diff --git a/package.json b/package.json index 13f7ca89..e528de43 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "postinstall": "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", - "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", "lighthouse": "lhci autorun" }, diff --git a/release.sh b/release.sh deleted file mode 100755 index d0797cd0..00000000 --- a/release.sh +++ /dev/null @@ -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