|
1 |
| -# name: Simple Build |
| 1 | +name: Simple Build |
2 | 2 |
|
3 |
| -# on: |
4 |
| -# push: |
5 |
| -# branches: ["deploy"] |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: ["deploy"] |
6 | 6 |
|
7 |
| -# jobs: |
8 |
| -# build: |
9 |
| -# runs-on: ubuntu-latest |
| 7 | +jobs: |
| 8 | + build: |
| 9 | + runs-on: ubuntu-latest |
10 | 10 |
|
11 |
| -# steps: |
12 |
| -# - name: Install Go |
13 |
| -# uses: actions/setup-go@v4 |
14 |
| -# with: |
15 |
| -# go-version: 1.22.x |
| 11 | + steps: |
| 12 | + - name: Install Go |
| 13 | + uses: actions/setup-go@v4 |
| 14 | + with: |
| 15 | + go-version: 1.22.x |
16 | 16 |
|
17 |
| -# - name: Checkout code |
18 |
| -# uses: actions/checkout@v4 |
| 17 | + - name: Checkout code |
| 18 | + uses: actions/checkout@v4 |
19 | 19 |
|
20 |
| -# - name: Build |
21 |
| -# run: make build |
| 20 | + - name: Build |
| 21 | + run: make build |
22 | 22 |
|
23 |
| -# - name: Upload build result |
24 |
| -# uses: actions/upload-artifact@v4 |
25 |
| -# with: |
26 |
| -# name: bin |
27 |
| -# path: ./bin |
| 23 | + - name: Upload build result |
| 24 | + uses: actions/upload-artifact@v4 |
| 25 | + with: |
| 26 | + name: bin |
| 27 | + path: ./bin |
28 | 28 |
|
29 |
| -# deploy: |
30 |
| -# runs-on: ubuntu-latest |
31 |
| -# needs: build |
32 |
| -# steps: |
33 |
| -# - name: Download bin file |
34 |
| -# uses: actions/download-artifact@v4 |
35 |
| -# with: |
36 |
| -# name: bin |
37 |
| -# path: ./bin |
| 29 | + deploy: |
| 30 | + runs-on: ubuntu-latest |
| 31 | + needs: build |
| 32 | + steps: |
| 33 | + - name: Download bin file |
| 34 | + uses: actions/download-artifact@v4 |
| 35 | + with: |
| 36 | + name: bin |
| 37 | + path: ./bin |
38 | 38 |
|
39 |
| -# - name: Transfer bin files to server |
40 |
| -# uses: appleboy/scp-action@master |
41 |
| -# with: |
42 |
| -# host: 37.139.41.110 |
43 |
| -# username: ubuntu |
44 |
| -# key: ${{ secrets.SSH_PRIVATE_KEY }} |
45 |
| -# debug: true |
46 |
| -# source: "bin/*" # <- Вот изменение: копируем все файлы из bin |
47 |
| -# target: "/home/ubuntu/bin" |
| 39 | + - name: Transfer bin files to server |
| 40 | + uses: appleboy/scp-action@master |
| 41 | + with: |
| 42 | + host: 37.139.41.110 |
| 43 | + username: ubuntu |
| 44 | + key: ${{ secrets.SSH_PRIVATE_KEY }} |
| 45 | + debug: true |
| 46 | + source: "bin/*" # <- Вот изменение: копируем все файлы из bin |
| 47 | + target: "/home/ubuntu/bin" |
48 | 48 |
|
49 |
| -# # - name: Transfer migrations files to server |
50 |
| -# # uses: appleboy/scp-action@master |
51 |
| -# # with: |
52 |
| -# # host: 37.139.41.110 |
53 |
| -# # username: ubuntu |
54 |
| -# # key: ${{ secrets.SSH_PRIVATE_KEY }} |
55 |
| -# # debug: true |
56 |
| -# # source: "migrations" |
57 |
| -# # target: "/home/ubuntu/bin" # <- убедитесь, что путь верный |
| 49 | + # - name: Transfer migrations files to server |
| 50 | + # uses: appleboy/scp-action@master |
| 51 | + # with: |
| 52 | + # host: 37.139.41.110 |
| 53 | + # username: ubuntu |
| 54 | + # key: ${{ secrets.SSH_PRIVATE_KEY }} |
| 55 | + # debug: true |
| 56 | + # source: "migrations" |
| 57 | + # target: "/home/ubuntu/bin" # <- убедитесь, что путь верный |
58 | 58 |
|
59 |
| -# - name: chmod all binaries |
60 |
| -# uses: appleboy/ssh-action@master |
61 |
| -# with: |
62 |
| -# host: 37.139.41.110 |
63 |
| -# username: ubuntu |
64 |
| -# key: ${{ secrets.SSH_PRIVATE_KEY }} |
65 |
| -# script: | # Многострочный скрипт для chmod |
66 |
| -# cd /home/ubuntu/bin |
67 |
| -# chmod 755 * |
| 59 | + - name: chmod all binaries |
| 60 | + uses: appleboy/ssh-action@master |
| 61 | + with: |
| 62 | + host: 37.139.41.110 |
| 63 | + username: ubuntu |
| 64 | + key: ${{ secrets.SSH_PRIVATE_KEY }} |
| 65 | + script: | # Многострочный скрипт для chmod |
| 66 | + cd /home/ubuntu/bin |
| 67 | + chmod 755 * |
68 | 68 |
|
69 |
| -# - name: restart service |
70 |
| -# uses: appleboy/ssh-action@master |
71 |
| -# with: |
72 |
| -# host: 37.139.41.110 |
73 |
| -# username: ubuntu |
74 |
| -# key: ${{ secrets.SSH_PRIVATE_KEY }} |
75 |
| -# script: sudo systemctl restart api.service |
| 69 | + - name: restart service |
| 70 | + uses: appleboy/ssh-action@master |
| 71 | + with: |
| 72 | + host: 37.139.41.110 |
| 73 | + username: ubuntu |
| 74 | + key: ${{ secrets.SSH_PRIVATE_KEY }} |
| 75 | + script: sudo systemctl restart api.service |
0 commit comments