From 9922f2c64e5aeec4d5bd3e390b7f5a675e9fda22 Mon Sep 17 00:00:00 2001 From: Matt Moretti Date: Mon, 21 Sep 2026 11:17:30 -0400 Subject: [PATCH 1/5] Update zip file target to depend on "gen" task --- Rakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index 45f5df42c..f64ec501c 100755 --- a/Rakefile +++ b/Rakefile @@ -92,7 +92,7 @@ task :clobber_zip do rm ZIP_FILE end -file ZIP_FILE => KOAN_FILES + [DOWNLOAD_DIR] do +file ZIP_FILE => [:gen, DOWNLOAD_DIR] do sh "zip #{ZIP_FILE} #{PROB_DIR}/*" end From 84cb7db260e3a94c981a7302d6ad2f0852cfd4d8 Mon Sep 17 00:00:00 2001 From: Matt Moretti Date: Mon, 21 Sep 2026 11:40:09 -0400 Subject: [PATCH 2/5] Add "deploy" action The action builds a new .zip file and commits it to default branch --- .github/workflows/deploy.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 000000000..7dfa9e7d6 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,34 @@ +name: deploy +on: + workflow_dispatch: + push: + branches: + - main + - master + paths: + - 'README.rdoc' + - 'src/**/*' +jobs: + deploy: + runs-on: ubuntu-latest + permissions: + actions: write + steps: + - uses: actions/create-github-app-token@v3 + id: koans-deploy-app-token + with: + client-id: ${{ vars.DEPLOY_CLIENT_ID }} + private-key: ${{ secrets.DEPLOY_APP_SECRET_KEY }} + owner: edgecase + repositories: ruby_koans + permission-contents: write + - uses: actions/checkout@v7 + with: + token: ${{ steps.koans-deploy-app-token.outputs.token }} + - run: 'rake package' + - run: |- + git config --global user.name 'GitHub Actions' + git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com' + git add download/ + git commit -m 'Update download .zip file [skip ci]' || true + git push From 61c3ff192d1fb3904525cdc3fc5996636853c9e7 Mon Sep 17 00:00:00 2001 From: Matt Moretti Date: Mon, 21 Sep 2026 11:49:36 -0400 Subject: [PATCH 3/5] Remove old scp-upload take task --- Rakefile | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Rakefile b/Rakefile index f64ec501c..af02d9d26 100755 --- a/Rakefile +++ b/Rakefile @@ -99,11 +99,6 @@ end desc "Create packaged files for distribution" task :package => [ZIP_FILE] -desc "Upload the package files to the web server" -task :upload => [ZIP_FILE] do - sh "scp #{ZIP_FILE} linode:sites/onestepback.org/download" -end - desc "Generate the Koans from the source files from scratch." task :regen => [:clobber_koans, :gen] From 7fb236219ad26665e9961a4b5aced8a8cde80868 Mon Sep 17 00:00:00 2001 From: Matt Moretti Date: Mon, 21 Sep 2026 12:56:25 -0400 Subject: [PATCH 4/5] Update deploy instructions --- DEPLOYING | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/DEPLOYING b/DEPLOYING index 3b91dc39f..c74e47cac 100644 --- a/DEPLOYING +++ b/DEPLOYING @@ -1,12 +1,15 @@ = Deploying a new Ruby Koans ZIP file The "Download" button on the rubykoans.com web-site points to the -download/rubykoans.zip file in the github repository. So to update the -download target on the web-site, just rebuild the .zip file, commit -and push the changes. +download/rubykoans.zip file in the GitHub repository. That file is +automatically updated by GitHub Actions when the source files are +updated. + +It can, of course, also be updated manually. To do so, just rebuild +the .zip file, commit, and push the changes. rake package git add download git push -That's it. \ No newline at end of file +That's it. From ba693e29bf2ebab2d2d8ae4c33936d6c3dfc7b25 Mon Sep 17 00:00:00 2001 From: Matt Moretti Date: Mon, 21 Sep 2026 13:12:27 -0400 Subject: [PATCH 5/5] Make var and secret names consistent --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 7dfa9e7d6..8b68fc346 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -17,7 +17,7 @@ jobs: - uses: actions/create-github-app-token@v3 id: koans-deploy-app-token with: - client-id: ${{ vars.DEPLOY_CLIENT_ID }} + client-id: ${{ vars.DEPLOY_APP_CLIENT_ID }} private-key: ${{ secrets.DEPLOY_APP_SECRET_KEY }} owner: edgecase repositories: ruby_koans