From 79a51a12583e4add3c1e2323e51c728b0b512348 Mon Sep 17 00:00:00 2001 From: robonen Date: Fri, 15 Apr 2022 01:37:50 +0700 Subject: [PATCH] CD pipeline --- .github/workflows/release.yml | 40 +++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..8144c3e --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,40 @@ +name: Release + +on: + + push: + tags: + - 'v*' + +jobs: + prepare: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Get the version + id: get_version + run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} + + - name: Deploy + uses: appleboy/scp-action@master + with: + host: ${{ secrets.SSH_HOST }} + username: ${{ secrets.SSH_USERNAME }} + password: ${{ secrets.SSH_PASSWORD }} + port: ${{ secrets.SSH_PORT }} + rm: true + strip_components: 1 + source: "dist/" + target: ${{ secrets.SERVER_DIR }} + + - name: Notify + uses: appleboy/telegram-action@master + with: + to: ${{ secrets.TELEGRAM_ID }} + token: ${{ secrets.TELEGRAM_TOKEN }} + format: markdown + message: | + ✅ *${{ github.actor }} выпустил новый релиз: ${{ github.repository }}: ${{ steps.get_version.outputs.VERSION }}*: + [Просмотреть релиз](https://forma-web.ru) \ No newline at end of file