From 88750c84910017194dcdea69daca7248ffeb9d0b Mon Sep 17 00:00:00 2001 From: Yonatan Miller Date: Sat, 29 Mar 2025 13:50:12 +0100 Subject: [PATCH 1/6] testing redirect of newsletter posts to a different format --- _config.yml | 1 + _redirects | 1 + 2 files changed, 2 insertions(+) create mode 100644 _redirects diff --git a/_config.yml b/_config.yml index 78a27af6..47e63a25 100644 --- a/_config.yml +++ b/_config.yml @@ -28,6 +28,7 @@ exclude: - .github/ include: + - _redirects - .htaccess # dependencies - yarn_deps/bootstrap/dist/css/bootstrap.min.css diff --git a/_redirects b/_redirects new file mode 100644 index 00000000..28560e5b --- /dev/null +++ b/_redirects @@ -0,0 +1 @@ +/:year/:month/:date/:slug https://techworkerscoalition.org/blog/:slug From 1eee5361a653bc71c9be5af6cfd10f78ac08e83f Mon Sep 17 00:00:00 2001 From: Yonatan Miller Date: Sat, 29 Mar 2025 13:59:27 +0100 Subject: [PATCH 2/6] try with trailing slash --- _redirects | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_redirects b/_redirects index 28560e5b..e015370c 100644 --- a/_redirects +++ b/_redirects @@ -1 +1 @@ -/:year/:month/:date/:slug https://techworkerscoalition.org/blog/:slug +/:year/:month/:date/:slug/ https://techworkerscoalition.org/blog/:slug 301 From 2bc96745b776f6544dd173fd9e8b74daa7e8d549 Mon Sep 17 00:00:00 2001 From: Yonatan Miller Date: Sat, 29 Mar 2025 14:12:56 +0100 Subject: [PATCH 3/6] remove github workflows to reduce CI build time --- .github/workflows/auto-publish.yml | 44 -------------- .github/workflows/ci.yml | 37 ------------ .github/workflows/danger.yml | 33 ----------- .github/workflows/link-checker.yml | 22 ------- .github/workflows/link_check_config.json | 7 --- .github/workflows/new-issue-pr.yml | 74 ------------------------ .github/workflows/optimize-images.yml | 74 ------------------------ .github/workflows/updated-twc-site.yml | 14 ----- 8 files changed, 305 deletions(-) delete mode 100644 .github/workflows/auto-publish.yml delete mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/danger.yml delete mode 100644 .github/workflows/link-checker.yml delete mode 100644 .github/workflows/link_check_config.json delete mode 100644 .github/workflows/new-issue-pr.yml delete mode 100644 .github/workflows/optimize-images.yml delete mode 100644 .github/workflows/updated-twc-site.yml diff --git a/.github/workflows/auto-publish.yml b/.github/workflows/auto-publish.yml deleted file mode 100644 index a4574a62..00000000 --- a/.github/workflows/auto-publish.yml +++ /dev/null @@ -1,44 +0,0 @@ -# GitHub Actions Virtual Environments -# https://github.com/actions/virtual-environments/ - -name: Auto-publish Newsletter - -on: -# Uncomment for debugging to manually trigger workflow -# -# workflow_dispatch: -# inputs: -# pull-request: -# description: 'Pull request number' -# required: true - schedule: - # Begin at 07:00am PST or 08:00am PDT every day. - # Will keep checking every 30 minutes for 3 hours. - # MailChimp is scheduled for 10:00am daily. - - # Cron runs in UTC - # PST is UTC-8:00 - # Thus, UTC 15:00-8:00 == 7:00am PST - # https://crontab.guru/#0,30_15-18_*_*_* - - cron: "0,30 15-18 * * *" - -jobs: - main: - name: Publish next issue - runs-on: ubuntu-latest - steps: - - name: current datetime - run: date - - # https://github.com/marketplace/actions/auto-merge-pull-request - - name: auto-merge - uses: reitermarkus/automerge@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - merge-method: squash - squash-title: true - required-labels: auto-publish - # Uncomment for debugging to manually trigger workflow - # - # pull-request: ${{ github.event.inputs.pull-request }} - # dry-run: true diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index b798e9d5..00000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,37 +0,0 @@ -# GitHub Actions Virtual Environments -# https://github.com/actions/virtual-environments/ - -name: CI - -on: - push: - branches: - - master - pull_request: - branches: - - master - -jobs: - main: - name: Build Site - runs-on: ubuntu-latest - steps: - - name: ruby versions - run: | - ruby --version - gem --version - - - name: git checkout - uses: actions/checkout@v4 - - # https://github.com/ruby/setup-ruby - - name: ruby setup - uses: ruby/setup-ruby@v1 - with: - ruby-version: 3.3.5 - bundler-cache: true - - - name: jekyll build - run: | - echo "$JEKYLL_ENV" - bundle exec jekyll build --verbose --trace diff --git a/.github/workflows/danger.yml b/.github/workflows/danger.yml deleted file mode 100644 index 343c7ca9..00000000 --- a/.github/workflows/danger.yml +++ /dev/null @@ -1,33 +0,0 @@ -# GitHub Actions Virtual Environments -# https://github.com/actions/virtual-environments/ - -name: Danger - -on: - pull_request: - types: [synchronize, opened, reopened, labeled] - -jobs: - main: - name: Review and Lint - runs-on: ubuntu-latest - steps: - - name: ruby versions - run: | - ruby --version - gem --version - - - name: git checkout - uses: actions/checkout@v4 - - # https://github.com/ruby/setup-ruby - - name: ruby setup - uses: ruby/setup-ruby@v1 - with: - ruby-version: 3.3.5 - bundler-cache: true - - - name: danger - env: - DANGER_GITHUB_API_TOKEN: ${{ secrets.DANGER_GITHUB_API_TOKEN }} - run: bundle exec danger --verbose diff --git a/.github/workflows/link-checker.yml b/.github/workflows/link-checker.yml deleted file mode 100644 index c370a351..00000000 --- a/.github/workflows/link-checker.yml +++ /dev/null @@ -1,22 +0,0 @@ -# GitHub Actions Virtual Environments -# https://github.com/actions/virtual-environments/ - -name: Link Checker - -on: - - pull_request - -jobs: - main: - name: Link Check - runs-on: ubuntu-latest - steps: - - name: git checkout - uses: actions/checkout@v4 - - # https://github.com/marketplace/actions/markdown-link-check - - name: markdown-link-check - uses: gaurav-nelson/github-action-markdown-link-check@v1 - with: - check-modified-files-only: 'yes' - config-file: '.github/workflows/link_check_config.json' diff --git a/.github/workflows/link_check_config.json b/.github/workflows/link_check_config.json deleted file mode 100644 index 534cc045..00000000 --- a/.github/workflows/link_check_config.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "timeout": "20s", - "retryOn429": true, - "retryCount": 5, - "fallbackRetryDelay": "20s", - "aliveStatusCodes": [0, 200, 206] -} diff --git a/.github/workflows/new-issue-pr.yml b/.github/workflows/new-issue-pr.yml deleted file mode 100644 index 6c06a584..00000000 --- a/.github/workflows/new-issue-pr.yml +++ /dev/null @@ -1,74 +0,0 @@ -# GitHub Actions Virtual Environments -# https://github.com/actions/virtual-environments/ - -name: Create New Issue - -on: - workflow_dispatch: - inputs: - volume: - description: 'Volume #' - required: true - default: '5' - issue: - description: 'Issue #' - required: true - date: - description: 'Date (YYYY-MM-DD)' - required: true - -jobs: - job-main: - name: Create issue PR - runs-on: ubuntu-latest - steps: - - name: ruby versions - run: | - ruby --version - gem --version - - - name: git checkout - uses: actions/checkout@v4 - with: - token: ${{ secrets.DANGER_GITHUB_API_TOKEN }} - - # https://github.com/ruby/setup-ruby - - name: ruby setup - uses: ruby/setup-ruby@v1 - with: - ruby-version: 3.3.5 - bundler-cache: true - - - name: generate issue template - run: make new-issue volume=${{ github.event.inputs.volume }} issue=${{ github.event.inputs.issue }} date=${{ github.event.inputs.date }} - - # https://github.com/marketplace/actions/create-pull-request - - name: create pull request - uses: peter-evans/create-pull-request@v5 - with: - token: ${{ secrets.DANGER_GITHUB_API_TOKEN }} - commit-message: Publish volume ${{ github.event.inputs.volume }}, issue ${{ github.event.inputs.issue }} (${{ github.event.inputs.date }}) - title: Publish volume ${{ github.event.inputs.volume }}, issue ${{ github.event.inputs.issue }} (${{ github.event.inputs.date }}) - body: | - :robot: *Auto-generated issue template.* This pull request was initiated by @${{ github.actor }}. - - # Checklist - - :nerd_face: [See the documentation for help](https://github.com/techworkersco/techworkersco.github.io/blob/master/.github/DOCUMENTATION.md). - - - [ ] Add initial content to the issue. - - [ ] Upload the header image and any others. - - :bulb: The bot will comment with an upload link. - - :warning: **Name the header image correctly** before uploading. Near the top of the template, you'll find the expected name. It should look something like `vol-3-issue-1-header.jpg`. Make sure the file name and extension match the template. Update the template if needed, for example, if you are uploading a `png` instead. - - [ ] Make final edits and proofread. - - [ ] **Approve** the pull request when finished. :white_check_mark: But, **do not merge**. - - [ ] Verify that **all checks are passing**. :white_check_mark: - - If status checks are failing, click "Details" next to the failing check. Read the logs and try to address the issue. - - [ ] Add the `auto-publish` label to [automatically merge this tomorrow morning](https://github.com/techworkersco/techworkersco.github.io/blob/master/.github/DOCUMENTATION.md#auto-publish-label)! - - branch: automated/vol${{ github.event.inputs.volume }}/issue${{ github.event.inputs.issue }}-${{ github.event.inputs.date }} - delete-branch: true - labels: next issue, automated - assignees: ${{ github.actor }} - reviewers: dellsystem, jessesquires, stationaery, kaylensanders, eddywashere - draft: false diff --git a/.github/workflows/optimize-images.yml b/.github/workflows/optimize-images.yml deleted file mode 100644 index 24ed2178..00000000 --- a/.github/workflows/optimize-images.yml +++ /dev/null @@ -1,74 +0,0 @@ -# GitHub Actions Virtual Environments -# https://github.com/actions/virtual-environments/ - -name: Optimize Images - -on: - pull_request: - types: [opened, reopened, synchronize, edited] - -jobs: - detect-files: - name: Find Added Images - runs-on: ubuntu-latest - steps: - - name: git checkout - uses: actions/checkout@v4 - with: - token: ${{ secrets.DANGER_GITHUB_API_TOKEN }} - fetch-depth: 0 - - # https://github.com/marketplace/actions/changed-files - - name: get changed files - id: changed-files - uses: tj-actions/changed-files@v13.1 - - - name: list all changed files - run: | - echo "Found modified files:" - for file in ${{ steps.changed-files.outputs.all_changed_files }}; do - echo "$file" - done - - - name: get all images - id: changed-images - uses: tj-actions/changed-files@v13.1 - with: - path: img - - outputs: - images_found: ${{ steps.changed-images.outputs.added_files }} - - optimize-images: - name: Optimize Added Images - needs: detect-files - if: ${{ needs.detect-files.outputs.images_found }} - runs-on: macOS-latest - steps: - - name: git checkout - uses: actions/checkout@v4 - with: - token: ${{ secrets.DANGER_GITHUB_API_TOKEN }} - ref: ${{ github.event.pull_request.head.ref }} - - - name: env status - run: | - echo "Images Found: ${{ needs.detect-files.outputs.images_found }}" - - - name: install ImageOptim - run: | - curl https://imageoptim.com/ImageOptim.tbz2 > ImageOptim.tbz2 - bzip2 -dc ImageOptim.tbz2 | tar xvf - - - - name: run ImageOptim - run: ImageOptim.app/Contents/MacOS/ImageOptim ${{ needs.detect-files.outputs.images_found }} - - - name: commit changes - run: | - git config --global user.email "${GITHUB_ACTOR}" - git config --global user.name "${GITHUB_ACTOR}@users.noreply.github.com" - git status - git pull - git add img/ - git commit -m "[automated] optimze images" || true - git push diff --git a/.github/workflows/updated-twc-site.yml b/.github/workflows/updated-twc-site.yml deleted file mode 100644 index f8989866..00000000 --- a/.github/workflows/updated-twc-site.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: rebuild-main-twc-site -on: - push: - branches: - - master - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: trigger netlify build - run: | - curl -X POST -d '{}' https://api.netlify.com/build_hooks/6277e1c305e5fd586b7e6e91&trigger_title=triggered+by+TWC+Newsletter+Github+Action+Flow From 754bd0a6957350aa8eb19e488255ce1c7a6a8bab Mon Sep 17 00:00:00 2001 From: Yonatan Miller Date: Sat, 29 Mar 2025 14:13:22 +0100 Subject: [PATCH 4/6] replace _redirects rule with netlify toml file --- _config.yml | 1 - _redirects | 1 - netlify.toml | 6 ++++++ 3 files changed, 6 insertions(+), 2 deletions(-) delete mode 100644 _redirects diff --git a/_config.yml b/_config.yml index 47e63a25..78a27af6 100644 --- a/_config.yml +++ b/_config.yml @@ -28,7 +28,6 @@ exclude: - .github/ include: - - _redirects - .htaccess # dependencies - yarn_deps/bootstrap/dist/css/bootstrap.min.css diff --git a/_redirects b/_redirects deleted file mode 100644 index e015370c..00000000 --- a/_redirects +++ /dev/null @@ -1 +0,0 @@ -/:year/:month/:date/:slug/ https://techworkerscoalition.org/blog/:slug 301 diff --git a/netlify.toml b/netlify.toml index 3b30fafa..76978e31 100644 --- a/netlify.toml +++ b/netlify.toml @@ -19,3 +19,9 @@ # or from the production branch will inherit these settings. [context.branch-deploy] JEKYLL_ENV = "development" + +[[redirects]] + from = "/:year/:month/:date/:slug" + to = "https://techworkerscoalition.org/blog/:slug" + status = 301 + force = true From ae6151b0629cdbc1de0260889b7427c4b9cbfc24 Mon Sep 17 00:00:00 2001 From: yonatan miller Date: Wed, 2 Apr 2025 21:15:30 +0200 Subject: [PATCH 5/6] Update netlify.toml Add specific domains to redirect and a wildcard beyond the actual blog posts themselves --- netlify.toml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/netlify.toml b/netlify.toml index 76978e31..ef9a3005 100644 --- a/netlify.toml +++ b/netlify.toml @@ -25,3 +25,15 @@ to = "https://techworkerscoalition.org/blog/:slug" status = 301 force = true + +[[redirects]] + from = "/subscribe/" + to = "https://techworkerscoalition.org/subscribe" + status = 301 + force = true + +[[redirects]] + from = "/*" + to = "https://techworkerscoalition.org/blog" + status = 301 + force = true From ba8da5006cc66f3aa5ab91d230c37d6051b4e5d5 Mon Sep 17 00:00:00 2001 From: yonatan miller Date: Wed, 2 Apr 2025 22:08:17 +0200 Subject: [PATCH 6/6] Update netlify.toml Match production blog url scheme --- netlify.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netlify.toml b/netlify.toml index ef9a3005..bd5c6945 100644 --- a/netlify.toml +++ b/netlify.toml @@ -22,7 +22,7 @@ [[redirects]] from = "/:year/:month/:date/:slug" - to = "https://techworkerscoalition.org/blog/:slug" + to = "https://techworkerscoalition.org/blog/:year/:month/:date/:slug" status = 301 force = true