Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -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_APP_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
11 changes: 7 additions & 4 deletions DEPLOYING
Original file line number Diff line number Diff line change
@@ -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.
That's it.
7 changes: 1 addition & 6 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -92,18 +92,13 @@ 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

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]

Expand Down