From 6399a5ed49ac1fce134306e605289380d8c6562a Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Wed, 25 Sep 2019 18:53:47 +0800 Subject: [PATCH] upgrade github actions Signed-off-by: Bo-Yi Wu --- .github/ci.yml | 40 ++++++++++++++++++++++++++++++++++++++++ .github/main.workflow | 38 -------------------------------------- Dockerfile | 2 +- 3 files changed, 41 insertions(+), 39 deletions(-) create mode 100644 .github/ci.yml delete mode 100644 .github/main.workflow diff --git a/.github/ci.yml b/.github/ci.yml new file mode 100644 index 0000000..959a7fa --- /dev/null +++ b/.github/ci.yml @@ -0,0 +1,40 @@ +name: telegram message +on: [push] +jobs: + + build: + name: Build + runs-on: ubuntu-latest + steps: + + - name: send custom message + uses: appleboy/telegram-action@master + env: + TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }} + TELEGRAM_TO: ${{ secrets.TELEGRAM_TO }} + with: + args: The ${{ github.event_name }} event triggered first step. + + - name: send message useing with + uses: appleboy/telegram-action@master + env: + TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }} + TELEGRAM_TO: ${{ secrets.TELEGRAM_TO }} + with: + message: The ${{ github.event_name }} event triggered second step. + + - name: send default message + uses: appleboy/telegram-action@master + env: + TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }} + TELEGRAM_TO: ${{ secrets.TELEGRAM_TO }} + + - name: send photo message + uses: appleboy/telegram-action@master + with: + message: send photo message + photo: tests/github.png + document: tests/gophercolor.png + env: + TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }} + TELEGRAM_TO: ${{ secrets.TELEGRAM_TO }} diff --git a/.github/main.workflow b/.github/main.workflow deleted file mode 100644 index 3b641ee..0000000 --- a/.github/main.workflow +++ /dev/null @@ -1,38 +0,0 @@ -workflow "Send Notification" { - on = "push" - resolves = [ - "Send Custom Message", - "Send Default Message", - "Send Photo Message", - ] -} - -action "Send Custom Message" { - uses = "appleboy/telegram-action@master" - secrets = [ - "TELEGRAM_TOKEN", - "TELEGRAM_TO", - ] - args = "A new commit has been pushed. commit: {{ commit.sha }}" -} - -action "Send Default Message" { - uses = "appleboy/telegram-action@master" - secrets = [ - "TELEGRAM_TOKEN", - "TELEGRAM_TO", - ] -} - -action "Send Photo Message" { - uses = "appleboy/telegram-action@master" - env = { - PHOTO = "tests/github.png" - DOCUMENT = "tests/gophercolor.png" - } - secrets = [ - "TELEGRAM_TOKEN", - "TELEGRAM_TO", - ] - args = "send photo message." -} diff --git a/Dockerfile b/Dockerfile index 737c0da..695b566 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM appleboy/drone-telegram:1.4.2-linux-amd64 +FROM appleboy/drone-telegram ADD entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh