Skip to content

Commit

Permalink
Merge pull request #12 from timfanda35/docs/add_github_action_sample
Browse files Browse the repository at this point in the history
[skip ci] add GitHub Action config sample
  • Loading branch information
timfanda35 committed Oct 1, 2022
2 parents c2cc59b + 1246628 commit 7773722
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,40 @@ References:

- [Webhook Resource](https://discord.com/developers/docs/resources/webhook#execute-webhook)


## GitHub Action Config Sample

Set the required environment variables in GitLab `Settings -> Secrets -> Acctions` page.

- `NOTIFY_TELEGRAM_TOKEN`
- `NOTIFY_TELEGRAM_CHAT_ID`

```
name: CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Notify
run: |
docker run \
-e NOTIFY_TELEGRAM_TOKEN="${{ secrets.NOTIFY_TELEGRAM_TOKEN }}" \
-e NOTIFY_TELEGRAM_CHAT_ID="${{ secrets.NOTIFY_TELEGRAM_CHAT_ID }}" \
ghcr.io/timfanda35/simple-channel-notify \
telegram --message="Notify Message~~~"
```

Reference: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions

## GitLab CI Config Sample

Set the required environment variables in GitLab `Settings -> CI/CD -> Variables` page.
Expand Down

0 comments on commit 7773722

Please sign in to comment.