From 76b6f1687cad87690ee802bd242c696a6480200d Mon Sep 17 00:00:00 2001 From: Alexander Pirsig Date: Thu, 26 Aug 2021 20:24:04 +0200 Subject: [PATCH 01/14] adds github initial build script --- .github/workflows/gh-pages.yml | 52 ++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/gh-pages.yml diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml new file mode 100644 index 000000000..4a14803d3 --- /dev/null +++ b/.github/workflows/gh-pages.yml @@ -0,0 +1,52 @@ +name: Build Github Pages + +on: + push: + branches: [ "src" ] + +jobs: + build: + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@v2 + with: + persist-credentials: false + + - name: Setup PHP with composer v1 + uses: shivammathur/setup-php@v2 + with: + php-version: '5.6' + tools: composer:v1 + + - name: Pin Composer + run: composer self-update 1.10.21 + + - name: Validate composer.json and composer.lock + run: composer validate + + - name: Cache Composer packages + id: composer-cache + uses: actions/cache@v2.1.6 + with: + path: vendor + key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-php- + + - name: Build satis repository + shell: bash + run: | + # Updates contents of satis.json + php bin/wp-org-api + php bin/satis build satis.json _site + cp _config/README.md _site/README.md + + - name: Composer Install dependencies + run: composer install --no-dev --no-interaction + + - name: Deploy 🚀 + uses: JamesIves/github-pages-deploy-action@4.1.1 + with: + branch: gh-pages + folder: _site/ From fdf295429b4f0f4db916377b72d3d0085b732603 Mon Sep 17 00:00:00 2001 From: Alexander Pirsig Date: Thu, 26 Aug 2021 20:28:04 +0200 Subject: [PATCH 02/14] install dependencies --- .github/workflows/gh-pages.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 4a14803d3..67660b84e 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -34,6 +34,9 @@ jobs: restore-keys: | ${{ runner.os }}-php- + - name: Install dependencies + run: composer install + - name: Build satis repository shell: bash run: | From fe66399dd8d01e0c01cafda60ade2dcc8c3b4d9f Mon Sep 17 00:00:00 2001 From: Alexander Pirsig Date: Thu, 26 Aug 2021 20:32:05 +0200 Subject: [PATCH 03/14] setup CNAME --- .github/workflows/gh-pages.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 67660b84e..a9755b09e 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -34,8 +34,8 @@ jobs: restore-keys: | ${{ runner.os }}-php- - - name: Install dependencies - run: composer install + - name: Composer Install dependencies + run: composer install --no-dev --no-interaction - name: Build satis repository shell: bash @@ -44,12 +44,14 @@ jobs: php bin/wp-org-api php bin/satis build satis.json _site cp _config/README.md _site/README.md - - - name: Composer Install dependencies - run: composer install --no-dev --no-interaction + # Add CNAME for the site + if [ "$SITE_DOMAIN" != "" ]; then + echo "Adding CNAME: $SITE_DOMAIN" + echo $SITE_DOMAIN > _site/CNAME + fi - name: Deploy 🚀 uses: JamesIves/github-pages-deploy-action@4.1.1 with: branch: gh-pages - folder: _site/ + folder: _site/ \ No newline at end of file From 573f7ced72d6a4932c5e4b6b63135b36a208a5fe Mon Sep 17 00:00:00 2001 From: Alexander Pirsig Date: Thu, 26 Aug 2021 20:39:37 +0200 Subject: [PATCH 04/14] remove travis build scripts --- .travis.yml | 29 ------------------------ _config/.travis.yml | 7 ------ bin/travis-deploy-to-gh-pages.sh | 38 -------------------------------- 3 files changed, 74 deletions(-) delete mode 100644 .travis.yml delete mode 100644 _config/.travis.yml delete mode 100755 bin/travis-deploy-to-gh-pages.sh diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index f0d4b8df6..000000000 --- a/.travis.yml +++ /dev/null @@ -1,29 +0,0 @@ -language: php -php: 5.6 # EOL version but can't refactor the code just now -sudo: false -install: - - composer install -before_install: - - composer self-update --rollback - - phpenv config-rm xdebug.ini -script: - # Updates contents of satis.json - - php bin/wp-org-api - # Builds new site based on satis.json - - php bin/satis build satis.json _site -cache: - directories: - - "$HOME/.composer/cache" -env: - global: - - GIT_COMMIT_EMAIL: wp-language-bot@keksi.io - - GIT_COMMIT_USER: WP-Languages bot - # Deploy into this branch - - TRAVIS_DEPLOY_BRANCH: master - - secure: gCrlCqnotIUvDpvVE1B55G1XI1kGdJhdaklVu4Rd6KwSbyK/BQBbOOL/QOu0lTxZKtQM0KVtcDCBFfaROLtat+/NQiUKEX+GoaqbErRucVbWvlrYqIY3P3HuUG20nLyBQ9Ake6ts3ORtOMQ1hbZAu9Ifzj6ll0A+D9obBztqsuS3p4ogDOU+aqTT+nMDzMtpTnWVhf2rHHns3wQNGXh8yJDdFtwbTbXVceNMsskgqbYOsu9za6yCdLxeqnIv68QO9yP+d+Ws5gcVuGk2YCqz28LNOVsMWHecaWBaWxgFvUIBZ+iGvoyloGjk1s4YWv3Y0eb2SEWEFidSHyeNA0uNVgPezqxMly0m9RNaG2Z1VouidWPciE9QObO6ZbzmqKrGkCRbCe5qSNZYWyqowtHLZJvKthV/fCn/yiaj0sIXqQns1HknjD+u34YtAhV71cja9aX1TQAL68ZXYeJd8j6u0nX6BmAiILH8VRzZ13ynx0W9qjjdA/8Iu8cKKpmrX/M1N/tiaWGa05FnkB88L/aoq3rAz3Ir1FR9R0Xa/2MmFVoBGlRjS8tn26MBVB8X3s7fpsOFulXAqGLUx9CEd6IqG/w3pPkdlT/F8Vsi7xzhpiXtiFiNdqhGf50u7O++XVlg6TcgGwFteB4WF+LFWpTNi7Z3iI3IB/9/asDE+nocrAQ= -deploy: - skip_cleanup: true - provider: script - script: bin/travis-deploy-to-gh-pages.sh - on: - branch: src diff --git a/_config/.travis.yml b/_config/.travis.yml deleted file mode 100644 index 646bccadb..000000000 --- a/_config/.travis.yml +++ /dev/null @@ -1,7 +0,0 @@ -language: php -sudo: false - -# Black builds from this branch -branches: - except: - - master diff --git a/bin/travis-deploy-to-gh-pages.sh b/bin/travis-deploy-to-gh-pages.sh deleted file mode 100755 index 76afa42d0..000000000 --- a/bin/travis-deploy-to-gh-pages.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash - -# Copy templates into build branch -cp _config/.travis.yml _site/.travis.yml -cp _config/README.md _site/README.md - -# Open the build folder -cd _site - -# Create completely new git repo -git init . - -# Config git -git config user.name "$GIT_COMMIT_USER" -git config user.email "$GIT_COMMIT_EMAIL" - -# Add CNAME for the site -if [ "$SITE_DOMAIN" != "" ]; then - echo "Adding CNAME: $SITE_DOMAIN" - echo $SITE_DOMAIN > CNAME -fi - -# sed all outputs so that $GITHUB_ACCESS_TOKEN can be removed from output - -# Add github as remote -{ git remote add github "https://$GITHUB_ACCESS_TOKEN@github.com/$TRAVIS_REPO_SLUG.git" 2>&1; } | \ - sed "s|$GITHUB_ACCESS_TOKEN|REDACTED|g" - -# and add all files -{ git add -A 2>&1; } | sed "s|$GITHUB_ACCESS_TOKEN|REDACTED|g" - -# Commit all files -{ git commit -am "Builded gh-pages from $TRAVIS_BRANCH in Travis CI\nCommit-ID:$TRAVIS_COMMIT" 2>&1; } | \ - sed "s|$GITHUB_ACCESS_TOKEN|REDACTED|g" - -# Push current master branch as gh-pages into github -{ git push github master:$TRAVIS_DEPLOY_BRANCH --force 2>&1; } | \ - sed "s|$GITHUB_ACCESS_TOKEN|REDACTED|g" From ac4a2705a494f093e7a4a4eee91219a5b0db8bb8 Mon Sep 17 00:00:00 2001 From: Alexander Pirsig Date: Thu, 26 Aug 2021 20:40:03 +0200 Subject: [PATCH 05/14] adds cron schedule --- .github/workflows/gh-pages.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index a9755b09e..cb8f00c7b 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -4,6 +4,10 @@ on: push: branches: [ "src" ] + schedule: + - cron: "42 * * * *" # Every hour + workflow_dispatch: + jobs: build: runs-on: ubuntu-20.04 @@ -20,7 +24,7 @@ jobs: tools: composer:v1 - name: Pin Composer - run: composer self-update 1.10.21 + run: composer self-update 1.10.22 # makes sure new Github tokes work - name: Validate composer.json and composer.lock run: composer validate @@ -40,10 +44,11 @@ jobs: - name: Build satis repository shell: bash run: | - # Updates contents of satis.json + # Build repository contents with satis php bin/wp-org-api php bin/satis build satis.json _site cp _config/README.md _site/README.md + # Add CNAME for the site if [ "$SITE_DOMAIN" != "" ]; then echo "Adding CNAME: $SITE_DOMAIN" @@ -53,5 +58,5 @@ jobs: - name: Deploy 🚀 uses: JamesIves/github-pages-deploy-action@4.1.1 with: - branch: gh-pages + branch: master folder: _site/ \ No newline at end of file From 40e58b364d3e956aa02fe22186d65fd47d9c09e6 Mon Sep 17 00:00:00 2001 From: Alexander Pirsig Date: Thu, 26 Aug 2021 20:45:09 +0200 Subject: [PATCH 06/14] cleanup --- .github/workflows/gh-pages.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index cb8f00c7b..3a816be83 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -3,10 +3,8 @@ name: Build Github Pages on: push: branches: [ "src" ] - schedule: - cron: "42 * * * *" # Every hour - workflow_dispatch: jobs: build: From 086cf3650226461631208c6da3ebfb0e0e407e64 Mon Sep 17 00:00:00 2001 From: Alexander Pirsig Date: Thu, 26 Aug 2021 20:45:28 +0200 Subject: [PATCH 07/14] every five minutes --- .github/workflows/gh-pages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 3a816be83..c45ac342e 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -4,7 +4,7 @@ on: push: branches: [ "src" ] schedule: - - cron: "42 * * * *" # Every hour + - cron: "*/5 * * * *" # Every hour jobs: build: From 9ef37433cef9ab4d2c9866e7b872f0a635087383 Mon Sep 17 00:00:00 2001 From: Alexander Pirsig Date: Thu, 26 Aug 2021 21:02:10 +0200 Subject: [PATCH 08/14] run at 12:15 --- .github/workflows/gh-pages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index c45ac342e..9d3ebbb5b 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -4,7 +4,7 @@ on: push: branches: [ "src" ] schedule: - - cron: "*/5 * * * *" # Every hour + - cron: "15 12 * * *" # at 12:15 jobs: build: From 6eff8aa8e14d2358d6abec14051f4a8cbda94b5b Mon Sep 17 00:00:00 2001 From: Alexander Pirsig Date: Thu, 26 Aug 2021 21:08:00 +0200 Subject: [PATCH 09/14] pass SITE_DOMAIN key --- .github/workflows/gh-pages.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 9d3ebbb5b..48e26edee 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -52,6 +52,8 @@ jobs: echo "Adding CNAME: $SITE_DOMAIN" echo $SITE_DOMAIN > _site/CNAME fi + env: + SITE_DOMAIN: ${{ secrets.SITE_DOMAIN }} - name: Deploy 🚀 uses: JamesIves/github-pages-deploy-action@4.1.1 From a978bc524fb12269056173d57edceadba6c25fbf Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 19 Oct 2021 18:31:19 +0200 Subject: [PATCH 10/14] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a4ae52040..d06f9df70 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ - If you would like to add more language files please submit a pull request. - Repos are updated daily with Travis CI. + ## Example configuration with composer This example adds all translations from finnish and french packages. From a7d9cd0567b6b5b266f8fe8af8af7729bc3a569b Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 20 Dec 2021 10:27:51 +0100 Subject: [PATCH 11/14] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index d06f9df70..cdd822204 100644 --- a/README.md +++ b/README.md @@ -86,7 +86,6 @@ Then add it to your composer like this example. You just need to update the vers ``` ## How to use this project as self-hosted version: - ``` # Clone the project to your own server $ git clone https://github.com/wp-languages/wp-languages.github.io /to/your/htdocs From 01cc5589adc88550506249d08e1689823bc3fd3a Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 14 Jan 2022 10:12:45 +0100 Subject: [PATCH 12/14] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index cdd822204..e558f2192 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,6 @@ - If you would like to add more language files please submit a pull request. - Repos are updated daily with Travis CI. - ## Example configuration with composer This example adds all translations from finnish and french packages. From 6741f1fdab937cc6fadef0d0767b324ff2a8e7d0 Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 6 Apr 2022 09:09:17 +0200 Subject: [PATCH 13/14] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index e558f2192..579d047e4 100644 --- a/README.md +++ b/README.md @@ -99,3 +99,4 @@ $ crontab -e ## License MIT License + From 1ed5376077dff276700594ced37883ebfd27af75 Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 9 Jan 2023 17:37:28 +0100 Subject: [PATCH 14/14] Create delete-old-workflow-runs-weekly.yml --- .../delete-old-workflow-runs-weekly.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/delete-old-workflow-runs-weekly.yml diff --git a/.github/workflows/delete-old-workflow-runs-weekly.yml b/.github/workflows/delete-old-workflow-runs-weekly.yml new file mode 100644 index 000000000..173737660 --- /dev/null +++ b/.github/workflows/delete-old-workflow-runs-weekly.yml @@ -0,0 +1,17 @@ +name: Delete old workflow runs +on: + workflow_dispatch: + schedule: + - cron: '5 4 * * 1' +# Run weekly, at 04:05 every Monday. + +jobs: + del_runs: + runs-on: ubuntu-latest + steps: + - name: Delete workflow runs + uses: GitRML/delete-workflow-runs@main + with: + token: ${{ github.token }} + repository: ${{ github.repository }} + retain_days: 30