diff --git a/.github/workflows/axe.yml b/.github/workflows/axe.yml deleted file mode 100644 index a745c7d..0000000 --- a/.github/workflows/axe.yml +++ /dev/null @@ -1,73 +0,0 @@ -name: Axe accessibility testing - -on: - # if you want to run this on every push uncomment the following lines - # push: - # branches: - # - master - # - main - # pull_request: - # branches: - # - master - # - main - workflow_dispatch: - inputs: - url: - description: "URL to be checked (e.g.: blog/)" - required: false - -env: - URL: "" - -jobs: - check: - # available images: https://github.com/actions/runner-images#available-images - runs-on: ubuntu-latest - steps: - - name: Checkout ๐Ÿ›Ž๏ธ - uses: actions/checkout@v4 - - name: Setup Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: "3.2.2" - bundler-cache: true - - name: Update _config.yml โš™๏ธ - uses: fjogeleit/yaml-update-action@main - with: - commitChange: false - valueFile: "_config.yml" - changes: | - { - "giscus.repo": "${{ github.repository }}", - "baseurl": "" - } - - name: Install and Build ๐Ÿ”ง - run: | - pip3 install --upgrade jupyter - export JEKYLL_ENV=production - bundle exec jekyll build --lsi - - name: Purge unused CSS ๐Ÿงน - run: | - npm install -g purgecss - purgecss -c purgecss.config.js - - name: Get Chromium version ๐ŸŒ - # https://github.com/GoogleChromeLabs/chrome-for-testing?tab=readme-ov-file#other-api-endpoints - run: | - CHROMIUM_VERSION=$(wget -qO- https://googlechromelabs.github.io/chrome-for-testing/LATEST_RELEASE_STABLE | cut -d. -f1) - echo "Chromium version: $CHROMIUM_VERSION" - echo "CHROMIUM_VERSION=$CHROMIUM_VERSION" >> $GITHUB_ENV - - name: Setup Chrome ๐ŸŒ - id: setup-chrome - uses: browser-actions/setup-chrome@v1 - with: - chrome-version: ${{ env.CHROMIUM_VERSION }} - - name: Install chromedriver ๐Ÿš— - run: | - npm install -g chromedriver@$CHROMIUM_VERSION - - name: Run axe ๐Ÿช“ - # https://github.com/dequelabs/axe-core-npm/tree/develop/packages/cli - run: | - npm install -g @axe-core/cli - npm install -g http-server - http-server _site/ & - axe --chromedriver-path $(npm root -g)/chromedriver/bin/chromedriver http://localhost:8080/${{ github.event.inputs.url || env.URL }} --load-delay=1500 --exit diff --git a/.github/workflows/broken-links-site.yml b/.github/workflows/broken-links-site.yml deleted file mode 100644 index fae797c..0000000 --- a/.github/workflows/broken-links-site.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: Check for broken links on site - -on: - workflow_run: - workflows: [Deploy site] - types: [completed] - -jobs: - check-links-on-site: - # https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#running-a-workflow-based-on-the-conclusion-of-another-workflow - if: ${{ github.event.workflow_run.conclusion == 'success' }} - # available images: https://github.com/actions/runner-images#available-images - runs-on: ubuntu-latest - steps: - - name: Checkout ๐Ÿ›Ž๏ธ - uses: actions/checkout@v4 - - name: Setup Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: "3.2.2" - bundler-cache: true - - name: Update _config.yml โš™๏ธ - uses: fjogeleit/yaml-update-action@main - with: - commitChange: false - valueFile: "_config.yml" - changes: | - { - "giscus.repo": "${{ github.repository }}", - "baseurl": "" - } - - name: Install and Build ๐Ÿ”ง - run: | - pip3 install --upgrade jupyter - export JEKYLL_ENV=production - bundle exec jekyll build --lsi - - name: Purge unused CSS ๐Ÿงน - run: | - npm install -g purgecss - purgecss -c purgecss.config.js - - name: Link Checker ๐Ÿ”— - uses: lycheeverse/lychee-action@v1.9.0 - with: - fail: true - # only check local links - args: --offline --remap '_site(/?.*)/assets/(.*) _site/assets/$2' --verbose --no-progress '_site/**/*.html' diff --git a/.github/workflows/broken-links.yml b/.github/workflows/broken-links.yml deleted file mode 100644 index 36d1d6e..0000000 --- a/.github/workflows/broken-links.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: Check for broken links - -on: - push: - branches: - - master - - main - paths: - - "assets/**" - - "**.html" - - "**.js" - - "**.liquid" - - "**/*.md" - - "**.yml" - - "!.github/workflows/axe.yml" - - "!.github/workflows/deploy-docker-tag.yml" - - "!.github/workflows/deploy-image.yml" - - "!.github/workflows/docker-slim.yml" - - "!.github/workflows/lighthouse-badger.yml" - - "!.github/workflows/prettier.yml" - - "!lighthouse_results/**" - pull_request: - branches: - - master - - main - paths: - - "assets/**" - - "**.html" - - "**.js" - - "**.liquid" - - "**/*.md" - - "**.yml" - - "!.github/workflows/axe.yml" - - "!.github/workflows/deploy-docker-tag.yml" - - "!.github/workflows/deploy-image.yml" - - "!.github/workflows/docker-slim.yml" - - "!.github/workflows/lighthouse-badger.yml" - - "!.github/workflows/prettier.yml" - - "!lighthouse_results/**" - -jobs: - link-checker: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Link Checker ๐Ÿ”— - uses: lycheeverse/lychee-action@v1.9.0 - with: - fail: true - # removed md files that include liquid tags - args: --exclude-path README.md --exclude-path _pages/404.md --exclude-path _pages/blog.md --exclude-path _posts/2018-12-22-distill.md --verbose --no-progress './**/*.md' './**/*.html' diff --git a/.github/workflows/deploy-docker-tag.yml b/.github/workflows/deploy-docker-tag.yml deleted file mode 100644 index fadfff6..0000000 --- a/.github/workflows/deploy-docker-tag.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: Docker Image CI (Upload Tag) - -on: - push: - tags: - - "v*" - paths: - - "bin/entry_point.sh" - - "Dockerfile" - - "Gemfile" - - "Gemfile.lock" - - "package.json" - - "package-lock.json" - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Buildx - uses: docker/setup-buildx-action@v3 - - - name: Docker meta - id: meta - uses: docker/metadata-action@v5 - with: - images: amirpourmand/al-folio - - - name: Login - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Build and push - uses: docker/build-push-action@v5 - with: - context: . - platforms: linux/amd64,linux/arm64/v8 - push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/deploy-image.yml b/.github/workflows/deploy-image.yml deleted file mode 100644 index 133f22d..0000000 --- a/.github/workflows/deploy-image.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Docker Image CI - -on: - push: - branches: - - master - - main - paths: - - "bin/entry_point.sh" - - "Dockerfile" - - "Gemfile" - - "Gemfile.lock" - - "package.json" - - "package-lock.json" - -jobs: - build: - runs-on: ubuntu-latest - if: github.repository_owner == 'alshedivat' - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Buildx - uses: docker/setup-buildx-action@v3 - - - name: Login - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Build and push - uses: docker/build-push-action@v5 - with: - context: . - push: true - platforms: linux/amd64,linux/arm64/v8 - tags: amirpourmand/al-folio diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index 4979e3e..0000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,89 +0,0 @@ -name: Deploy site - -on: - push: - branches: - - master - - main - paths: - - "assets/**" - - "**.html" - - "**.js" - - "**.liquid" - - "**/*.md" - - "**.yml" - - "!.github/workflows/axe.yml" - - "!.github/workflows/broken-links.yml" - - "!.github/workflows/deploy-docker-tag.yml" - - "!.github/workflows/deploy-image.yml" - - "!.github/workflows/docker-slim.yml" - - "!.github/workflows/lighthouse-badger.yml" - - "!.github/workflows/prettier.yml" - - "!lighthouse_results/**" - - "!CONTRIBUTING.md" - - "!CUSTOMIZE.md" - - "!FAQ.md" - - "!INSTALL.md" - - "!README.md" - pull_request: - branches: - - master - - main - paths: - - "assets/**" - - "**.html" - - "**.js" - - "**.liquid" - - "**/*.md" - - "**.yml" - - "!.github/workflows/axe.yml" - - "!.github/workflows/broken-links.yml" - - "!.github/workflows/deploy-docker-tag.yml" - - "!.github/workflows/deploy-image.yml" - - "!.github/workflows/docker-slim.yml" - - "!.github/workflows/lighthouse-badger.yml" - - "!.github/workflows/prettier.yml" - - "!lighthouse_results/**" - - "!CONTRIBUTING.md" - - "!CUSTOMIZE.md" - - "!FAQ.md" - - "!INSTALL.md" - - "!README.md" - workflow_dispatch: - -permissions: - contents: write - -jobs: - deploy: - # available images: https://github.com/actions/runner-images#available-images - runs-on: ubuntu-latest - steps: - - name: Checkout ๐Ÿ›Ž๏ธ - uses: actions/checkout@v4 - - name: Setup Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: "3.2.2" - bundler-cache: true - - name: Update _config.yml โš™๏ธ - uses: fjogeleit/yaml-update-action@main - with: - commitChange: false - valueFile: "_config.yml" - propertyPath: "giscus.repo" - value: ${{ github.repository }} - - name: Install and Build ๐Ÿ”ง - run: | - pip3 install --upgrade jupyter - export JEKYLL_ENV=production - bundle exec jekyll build --lsi - - name: Purge unused CSS ๐Ÿงน - run: | - npm install -g purgecss - purgecss -c purgecss.config.js - - name: Deploy ๐Ÿš€ - if: github.event_name != 'pull_request' - uses: JamesIves/github-pages-deploy-action@v4 - with: - folder: _site diff --git a/.github/workflows/docker-slim.yml b/.github/workflows/docker-slim.yml deleted file mode 100644 index 8c8cf71..0000000 --- a/.github/workflows/docker-slim.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: Docker Slim - -#Only trigger, when the build workflow succeeded -on: - workflow_run: - workflows: ["Docker Image CI"] - types: - - completed - -# on: -# push: -# branches: -# - 'master' - -jobs: - build: - # https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#running-a-workflow-based-on-the-conclusion-of-another-workflow - if: ${{ github.event.workflow_run.conclusion == 'success' }} and github.repository_owner == 'alshedivat' - runs-on: ubuntu-latest - defaults: - run: - working-directory: ${{ github.workspace }} - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Login - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: update docker-compose - shell: bash - run: | - sed -i "s|\.:|${{ github.workspace }}:|g" ${{ github.workspace }}/docker-compose.yml - cat ${{ github.workspace }}/docker-compose.yml - - - uses: kitabisa/docker-slim-action@v1.0.3 - env: - DSLIM_PULL: true - DSLIM_COMPOSE_FILE: ${{ github.workspace }}/docker-compose.yml - DSLIM_TARGET_COMPOSE_SVC: jekyll - DSLIM_CONTINUE_AFTER: signal - with: - target: amirpourmand/al-folio - tag: "slim" - - # Push to the registry - - run: docker image push amirpourmand/al-folio:slim diff --git a/.github/workflows/hugo.yml b/.github/workflows/hugo.yml new file mode 100644 index 0000000..c3846d3 --- /dev/null +++ b/.github/workflows/hugo.yml @@ -0,0 +1,78 @@ +# Sample workflow for building and deploying a Hugo site to GitHub Pages +name: Deploy Hugo site to Pages + +on: + # Runs on pushes targeting the default branch + push: + branches: + - master + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + +# Default to bash +defaults: + run: + shell: bash + +jobs: + # Build job + build: + runs-on: ubuntu-latest + env: + HUGO_VERSION: 0.124.0 + steps: + - name: Install Hugo CLI + run: | + wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \ + && sudo dpkg -i ${{ runner.temp }}/hugo.deb + - name: Install Dart Sass + run: sudo snap install dart-sass + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + fetch-depth: 0 + - name: Setup Pages + id: pages + uses: actions/configure-pages@v4 + - name: Install Node.js dependencies + run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true" + - name: Build with Hugo + env: + # For maximum backward compatibility with Hugo modules + HUGO_ENVIRONMENT: production + HUGO_ENV: production + run: | + hugo \ + --gc \ + --minify \ + --baseURL "${{ steps.pages.outputs.base_url }}/" + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: ./public + + # Deployment job + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 \ No newline at end of file diff --git a/.github/workflows/jekyll.yml b/.github/workflows/jekyll.yml deleted file mode 100644 index 61cb2f0..0000000 --- a/.github/workflows/jekyll.yml +++ /dev/null @@ -1,64 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - -# Sample workflow for building and deploying a Jekyll site to GitHub Pages -name: Deploy Jekyll site to Pages - -on: - # Runs on pushes targeting the default branch - push: - branches: ["master"] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages -permissions: - contents: read - pages: write - id-token: write - -# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. -# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. -concurrency: - group: "pages" - cancel-in-progress: false - -jobs: - # Build job - build: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Setup Ruby - uses: ruby/setup-ruby@8575951200e472d5f2d95c625da0c7bec8217c42 # v1.161.0 - with: - ruby-version: '3.1' # Not needed with a .ruby-version file - bundler-cache: true # runs 'bundle install' and caches installed gems automatically - cache-version: 0 # Increment this number if you need to re-download cached gems - - name: Setup Pages - id: pages - uses: actions/configure-pages@v4 - - name: Build with Jekyll - # Outputs to the './_site' directory by default - run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}" - env: - JEKYLL_ENV: production - - name: Upload artifact - # Automatically uploads an artifact from the './_site' directory by default - uses: actions/upload-pages-artifact@v3 - - # Deployment job - deploy: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest - needs: build - steps: - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 diff --git a/.github/workflows/lighthouse-badger.yml b/.github/workflows/lighthouse-badger.yml deleted file mode 100644 index 182517c..0000000 --- a/.github/workflows/lighthouse-badger.yml +++ /dev/null @@ -1,63 +0,0 @@ -# Lighthouse-Badger-Easy | GitHub Action Workflow -# -# Description: Generates, adds & updates manually/automatically Lighthouse badges & reports from one/multiple input URL(s) to the current repository & main branch with minimal settings -# Author: Sitdisch -# Source: https://github.com/myactionway/lighthouse-badger-workflows -# License: MIT -# Copyright (c) 2021 Sitdisch - -name: "Lighthouse Badger" - -######################################################################## -# DEFINE YOUR INPUTS AND TRIGGERS IN THE FOLLOWING -######################################################################## - -# INPUTS as environmental variables (env) for not manually triggered workflows -env: - URLS: https://alshedivat.github.io/al-folio/ - TOKEN_NAME: LIGHTHOUSE_BADGER_TOKEN - # If any of the following env is blank, a default value is used instead - REPO_BRANCH: "${{ github.repository }} master" # target repository & branch e.g. 'dummy/mytargetrepo main' - MOBILE_LIGHTHOUSE_PARAMS: "--only-categories=performance,accessibility,best-practices,seo --throttling.cpuSlowdownMultiplier=2" - DESKTOP_LIGHTHOUSE_PARAMS: "--only-categories=performance,accessibility,best-practices,seo --preset=desktop --throttling.cpuSlowdownMultiplier=1" - -# TRIGGERS -on: - page_build: - # schedule: # Check your schedule here => https://crontab.guru/ - # - cron: '55 23 * * 0' # e.g. every Sunday at 23:55 - # - # THAT'S IT; YOU'RE DONE; - workflow_dispatch: - -######################################################################## -# THAT'S IT; YOU DON'T HAVE TO DEFINE ANYTHING IN THE FOLLOWING -######################################################################## - -jobs: - lighthouse-badger-easy: - runs-on: ubuntu-latest - timeout-minutes: 8 - steps: - - name: Preparatory Tasks - run: | - REPOSITORY=`expr "${{ env.REPO_BRANCH }}" : "\([^ ]*\)"` - BRANCH=`expr "${{ env.REPO_BRANCH }}" : ".* \([^ ]*\)"` - echo "REPOSITORY=$REPOSITORY" >> $GITHUB_ENV - echo "BRANCH=$BRANCH" >> $GITHUB_ENV - env: - REPO_BRANCH: ${{ env.REPO_BRANCH }} - - uses: actions/checkout@v4 - with: - repository: ${{ env.REPOSITORY }} - token: ${{ secrets[github.event.inputs.token_name] || secrets[env.TOKEN_NAME] }} - ref: ${{ env.BRANCH }} - - uses: actions/checkout@v4 - with: - repository: "myactionway/lighthouse-badges" - path: temp_lighthouse_badges_nested - - uses: myactionway/lighthouse-badger-action@v2.2 - with: - urls: ${{ env.URLS }} - mobile_lighthouse_params: ${{ env.MOBILE_LIGHTHOUSE_PARAMS }} - desktop_lighthouse_params: ${{ env.DESKTOP_LIGHTHOUSE_PARAMS }} diff --git a/.github/workflows/prettier-comment-on-pr.yml b/.github/workflows/prettier-comment-on-pr.yml deleted file mode 100644 index e95075c..0000000 --- a/.github/workflows/prettier-comment-on-pr.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Comment on pull request - -on: - repository_dispatch: - types: [prettier-failed-on-pr] - -jobs: - comment: - # available images: https://github.com/actions/runner-images#available-images - runs-on: ubuntu-latest - steps: - - name: PR comment with html diff ๐Ÿ’ฌ - uses: thollander/actions-comment-pull-request@v2 - with: - comment_tag: prettier-failed - pr_number: ${{ github.event.client_payload.pr_number }} - message: | - Failed [prettier code check](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.event.client_payload.run_id }}). Check [this file](${{ github.event.client_payload.artifact_url }}) for more information. diff --git a/.github/workflows/prettier.yml b/.github/workflows/prettier.yml deleted file mode 100644 index 60446c8..0000000 --- a/.github/workflows/prettier.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: Prettier code formatter - -on: - pull_request: - branches: - - master - - main - push: - branches: - - master - - main - -jobs: - check: - # available images: https://github.com/actions/runner-images#available-images - runs-on: ubuntu-latest - steps: - - name: Checkout ๐Ÿ›Ž๏ธ - uses: actions/checkout@v4 - - name: Setup Node.js โš™๏ธ - uses: actions/setup-node@v4 - - name: Install Prettier ๐Ÿ’พ - run: npm install --save-dev --save-exact prettier @shopify/prettier-plugin-liquid - - name: Prettier Check ๐Ÿ”Ž - id: prettier - run: npx prettier . --check - - name: Create diff ๐Ÿ“ - # https://docs.github.com/en/actions/learn-github-actions/expressions#failure - if: ${{ failure() }} - run: | - npx prettier . --write - git diff -- . ':(exclude)package-lock.json' ':(exclude)package.json' > diff.txt - npm install -g diff2html-cli - diff2html -i file -s side -F diff.html -- diff.txt - - name: Upload html diff โฌ†๏ธ - id: artifact-upload - if: ${{ failure() && steps.prettier.conclusion == 'failure' }} - uses: actions/upload-artifact@v4 - with: - name: HTML Diff - path: diff.html - retention-days: 7 - - name: Dispatch information to repository ๐Ÿ—ฃ๏ธ - if: ${{ failure() && steps.prettier.conclusion == 'failure' && github.event_name == 'pull_request' }} - uses: peter-evans/repository-dispatch@v2 - with: - event-type: prettier-failed-on-pr - client-payload: '{"pr_number": "${{ github.event.number }}", "artifact_url": "${{ steps.artifact-upload.outputs.artifact-url }}", "run_id": "${{ github.run_id }}"}'