mirror of
https://github.com/robonen/metr.git
synced 2026-03-20 02:44:42 +00:00
CD pipeline
This commit is contained in:
40
.github/workflows/release.yml
vendored
Normal file
40
.github/workflows/release.yml
vendored
Normal file
@@ -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)
|
||||
Reference in New Issue
Block a user