actions: Improve the secrets of one click release action.

This commit is contained in:
Vishnu KS 2021-04-05 23:08:45 +05:30 committed by Alex Vandiver
parent ffd0d822fe
commit f00c13d303
3 changed files with 10 additions and 13 deletions

View File

@ -9,11 +9,11 @@ jobs:
- uses: actions/checkout@v2
- name: Update DigitalOcean one click app
env:
DIGITALOCEAN_API_KEY: ${{ secrets.DIGITALOCEAN_API_KEY }}
ZULIP_API_KEY: ${{ secrets.ZULIP_BOT_API_KEY }}
ZULIP_EMAIL: ${{ secrets.ZULIP_BOT_EMAIL }}
ZULIP_SITE: ${{ secrets.ZULIP_ORGANIZATION_URL }}
ZULIP_STREAM_TO_SEND_BOT_MESSAGES: ${{ secrets.ZULIP_STREAM_TO_SEND_BOT_MESSAGES }}
DIGITALOCEAN_API_KEY: ${{ secrets.ONE_CLICK_ACTION_DIGITALOCEAN_API_KEY }}
ZULIP_API_KEY: ${{ secrets.ONE_CLICK_ACTION_ZULIP_BOT_API_KEY }}
ZULIP_EMAIL: ${{ secrets.ONE_CLICK_ACTION_ZULIP_BOT_EMAIL }}
ZULIP_SITE: https://chat.zulip.org
ONE_CLICK_ACTION_STREAM: kandra-ops
PYTHON_DIGITALOCEAN_REQUEST_TIMEOUT_SEC: 30
RELEASE_VERSION: ${{ github.event.release.tag_name }}
run: |

View File

@ -18,12 +18,9 @@ server release.
You also need to set the following secrets in your GitHub repository to make the action
work correctly. These secrets are passed as environment variables to the GitHub action.
* `DIGITALOCEAN_API_KEY` - DigitalOcean API KEY used for creating droplets, snapshots etc.
* `ZULIP_ORGANIZATION_URL` - The URL of the Zulip organization where the message containing
droplet/image details should be sent.
* `ZULIP_BOT_API_KEY` - The API key of the Zulip Bot used for sending messages.
* `ZULIP_STREAM_TO_SEND_BOT_MESSAGES` - The stream to which the messages should be sent.
* `ZULIP_BOT_EMAIL` - The email of the Zulip bot.
* `ONE_CLICK_ACTION_DIGITALOCEAN_API_KEY` - DigitalOcean API key used for creating droplets, snapshots etc.
* `ONE_CLICK_ACTION_ZULIP_BOT_API_KEY` - The API key of the Zulip bot used for sending messages.
* `ONE_CLICK_ACTION_ZULIP_BOT_EMAIL` - The email of the Zulip bot.
Also pass the following as environment variables in `.github/workflows/update-oneclick-apps.yml`.
* `PYTHON_DIGITALOCEAN_REQUEST_TIMEOUT_SEC` - This configures the maximum number of seconds

View File

@ -122,8 +122,8 @@ def setup_one_click_app_installer(droplet: digitalocean.Droplet) -> None:
def send_message(content: str) -> None:
request = {
"type": "stream",
"to": os.environ["ZULIP_STREAM_TO_SEND_BOT_MESSAGES"],
"topic": "DigitalOcean One Click App",
"to": os.environ["ONE_CLICK_ACTION_STREAM"],
"topic": "digitalocean installer",
"content": content,
}
zulip_client.send_message(request)