-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (59 loc) · 1.69 KB
/
grpc_ci.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
54
55
56
57
58
59
#name: CI
#
#on:
# push:
# branches: [ main, master]
# pull_request:
# branches: [ main, master]
#
#env:
# REGISTRY: "cr.selcloud.ru/xeeetu"
# IMAGE_NAME: "crud-server"
# CONTAINER_NAME: "crud-server-container"
#
#jobs:
# image-build-and-push:
# runs-on: ubuntu-latest
#
# steps:
# - name: Checkout master
# uses: actions/checkout@v3
#
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v2
#
# - name: Login to Docker Registry
# run: docker login -u ${{ secrets.REGISTRY_USERNAME }} -p ${{ secrets.REGISTRY_PASSWORD }} $REGISTRY
#
# - name: Build and Push Docker Image
# run: |
# TAG_NAME=$(echo $GITHUB_SHA | head -c7)
# docker buildx create --use
# docker buildx build --no-cache --push --tag $REGISTRY/$IMAGE_NAME:$TAG_NAME .
#
# deploy-image:
# runs-on: ubuntu-latest
# needs: image-build-and-push
#
# steps:
# - name: Deploy to Selectel Cloud via SSH action
# uses: appleboy/[email protected]
# with:
# host: ${{ secrets.SERVER_HOST }}
# username: $${{ secrets.SSH_USERNAME }}
# key: ${{ secrets.SSHKEY }}
# envs: IMAGE_NAME, REGISTRY, GITHUB
# script: |
# # Set up variables
# TAG_NAME=$(echo $GITHUB_SHA | head -c7)
#
# # Login into Selectel Registry
# docker login -u ${{ secrets.REGISTRY_USERNAME }} -p ${{ secrets.REGISTRY_PASSWORD }} $REGISTRY
#
# # Stop running container
# docker stop $COMTAINER_NAME
#
# # Remove old container
# docker rm $CONTAINER_NAME
#
# docker run -d -p 50051:50051 --name $CONTAINER_NAME -t $REGISTRY/$IMAGE_NAME:$TAG