-
Notifications
You must be signed in to change notification settings - Fork 3
53 lines (45 loc) · 1.44 KB
/
release.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Tag, Release & Deploy
on:
push:
branches: [master]
workflow_dispatch:
jobs:
release:
name: Tag & Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
name: Checkout [master]
with:
fetch-depth: 0
- name: Setup Git Config
run: |
git config user.name = "GitHub Actions Bot"
git config user.email = "<>"
- name: Create new Tag
run: git tag -a ${{ github.run_number }} -m "Release v${{ github.run_number}}"
- name: Push Tag
run: git push --tags
- name: Create and Publish Release
run: gh release create ${{ github.run_number }} --generate-notes -t "Release v${{ github.run_number }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
deploy:
name: Build Docker Image and deploy to Azure Linux VM
runs-on: ubuntu-latest
needs: release
steps:
- name: Login to SSH
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.host }}
username: ${{ secrets.username }}
key: ${{ secrets.key }}
script: |
sudo docker kill $(sudo docker ps -q)
yes | sudo docker system prune -a
rm -rf 1337x-bot
git clone [email protected]:brandongallagher1999/1337x-bot.git
cd 1337x-bot
echo { '"token"' : '"'${{ secrets.token }}'"' } > config.json
sudo docker-compose up -d