Skip to content

Commit de88851

Browse files
committed
Added dispatch command
1 parent 1312da4 commit de88851

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

.github/workflows/update_site.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ name: CI
22

33
on:
44
repository_dispatch: {}
5+
workflow_dispatch:
6+
inputs:
7+
action:
8+
description: 'Which action/command to run'
9+
required: true
10+
default: 'all'
511

612
jobs:
713
update_site:
@@ -23,5 +29,6 @@ jobs:
2329
{ if: "github.event.action == 'refdoc'", name: 'Update refdoc', run: 'python update.py --download --githubtoken=${{ secrets.SERVICES_GITHUB_TOKEN }} refdoc searchindex commit' },
2430
{ if: "github.event.action == 'examples'", name: 'Update examples', run: 'python update.py --download --githubtoken=${{ secrets.SERVICES_GITHUB_TOKEN }} examples commit' },
2531
{ if: "github.event.action == 'codepad'", name: 'Update codepad', run: 'python update.py --download --githubtoken=${{ secrets.SERVICES_GITHUB_TOKEN }} codepad commit' },
32+
{ if: "github.event.action == 'all'", name: 'Update everything', run: 'python update.py --download --githubtoken=${{ secrets.SERVICES_GITHUB_TOKEN }} all commit' },
2633
{ if: "startsWith(github.event.action, 'extension-')", name: 'Update extension', run: 'python update.py --download --githubtoken=${{ secrets.SERVICES_GITHUB_TOKEN }} --extension ${{ github.event.action }} extensions refdoc searchindex commit' }
2734
]

update.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1449,11 +1449,11 @@ def commit_changes(githubtoken):
14491449
call("git push 'https://%[email protected]/defold/defold.github.io.git' HEAD:master" % (githubtoken))
14501450

14511451

1452-
ALL_COMMANDS = [ "docs", "refdoc", "asset-portal", "games-showcase", "examples", "codepad", "commit", "searchindex", "extensions" ]
1452+
ALL_COMMANDS = [ "all", "help", "docs", "refdoc", "asset-portal", "games-showcase", "examples", "codepad", "commit", "searchindex", "extensions" ]
14531453
ALL_COMMANDS.sort()
14541454

14551455
parser = ArgumentParser()
1456-
parser.add_argument('commands', nargs="+", help='Commands (' + ', '.join(ALL_COMMANDS) + ', all, help)')
1456+
parser.add_argument('commands', nargs="+", help='Commands (' + ', '.join(ALL_COMMANDS) + ')')
14571457
parser.add_argument("--githubtoken", dest="githubtoken", help="Authentication token for GitHub API and ")
14581458
parser.add_argument("--extension", dest="extensions", action='append', help="Which extension to process")
14591459
parser.add_argument("--download", dest="download", action='store_true', help="Download updated content for the command(s) in question")
@@ -1475,13 +1475,15 @@ def commit_changes(githubtoken):
14751475
"""
14761476

14771477
if "all" in args.commands:
1478-
args.commands.remove("all")
14791478
commands = []
14801479
commands.extend(ALL_COMMANDS)
1481-
commands.extend(args.commands)
1480+
commands.remove("all")
1481+
commands.remove("help")
1482+
# make sure commit is the last command
1483+
commands.remove("commit")
1484+
commands.append("commit")
14821485
args.commands = commands
14831486

1484-
14851487
for command in args.commands:
14861488
if command == "help":
14871489
parser.print_help()

0 commit comments

Comments
 (0)