Compare commits

...

3 Commits

Author SHA1 Message Date
Xinwei Xiong(cubxxw-openim) 692ff29a0c feat: add script yaml
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
2023-07-27 15:51:57 +08:00
Xinwei Xiong(cubxxw-openim) de641f574c feat: add script yaml
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
2023-07-27 15:36:24 +08:00
Xinwei Xiong(cubxxw-openim) 57374a4df4 docs: add readme docs
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
2023-07-27 15:36:24 +08:00
3 changed files with 72 additions and 50 deletions
+31 -7
View File
@@ -29,30 +29,31 @@ jobs:
- name: Check out the repo - name: Check out the repo
uses: actions/checkout@v3 uses: actions/checkout@v3
# docker.io/openim/openim-server:latest
- name: Log in to Docker Hub - name: Log in to Docker Hub
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 uses: docker/login-action@v2
with: with:
username: ${{ secrets.DOCKER_USERNAME }} username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }} password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract metadata (tags, labels) for Docker - name: Extract metadata (tags, labels) for Docker
id: meta id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 uses: docker/metadata-action@v4.6.0
with: with:
images: openim/openim-server images: openim/openim-server
tags: latest tags: latest
- name: Build and push Docker image - name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc uses: docker/build-push-action@v4
with: with:
context: . context: .
push: true push: true
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}
# registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-server:latest
- name: Log in to AliYun Docker Hub - name: Log in to AliYun Docker Hub
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 uses: docker/login-action@v2
with: with:
registry: registry.cn-hangzhou.aliyuncs.com registry: registry.cn-hangzhou.aliyuncs.com
username: ${{ secrets.ALIREGISTRY_USERNAME }} username: ${{ secrets.ALIREGISTRY_USERNAME }}
@@ -60,19 +61,42 @@ jobs:
- name: Extract metadata (tags, labels) for Docker - name: Extract metadata (tags, labels) for Docker
id: meta2 id: meta2
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 uses: docker/metadata-action@v4.6.0
with: with:
images: registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-server images: registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-server
tags: latest tags: latest
- name: Build and push Docker image - name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc uses: docker/build-push-action@v4
with: with:
context: . context: .
push: true push: true
tags: ${{ steps.meta2.outputs.tags }} tags: ${{ steps.meta2.outputs.tags }}
labels: ${{ steps.meta2.outputs.labels }} labels: ${{ steps.meta2.outputs.labels }}
# ghcr.io/openim/openim-server:latest
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta3
uses: docker/metadata-action@v4.6.0
with:
images: openim/openim-server
tags: latest
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ steps.meta3.outputs.tags }}
labels: ${{ steps.meta3.outputs.labels }}
# name: OpenIM Build Docker Images # name: OpenIM Build Docker Images
# on: # on:
# push: # push:
+39 -41
View File
@@ -12,48 +12,46 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
name: deploy for dev name: OpenIM Deploy for dev
on: on:
push: push:
branches: branches:
- 'devops' # Only for the dev branch - 'devops' # Only for the dev branch
paths: paths:
- '.github/workflows/*' - '.github/workflows/*'
# - '__test__/**' # dev No immediate testing is required # - '__test__/**' # dev No immediate testing is required
- 'src/**' - 'src/**'
- 'Dockerfile' - 'Dockerfile'
- 'docker-compose.yml' - 'docker-compose.yml'
- 'bin/*' - 'bin/*'
jobs: jobs:
deploy-dev: deploy-dev:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps:
steps: - uses: actions/checkout@v2
- uses: actions/checkout@v2 - name: set ssh key # Temporarily set up ssh key
- name: set ssh key # Temporarily set up ssh key run: |
run: | mkdir -p ~/.ssh/
mkdir -p ~/.ssh/ # secrets.WFP_ID_RSA set in GitHub
# secrets.WFP_ID_RSA set in GitHub echo "${{secrets.WFP_ID_RSA}}" > ~/.ssh/id_rsa
echo "${{secrets.WFP_ID_RSA}}" > ~/.ssh/id_rsa chmod 600 ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa ssh-keyscan "182.92.xxx.xxx" >> ~/.ssh/known_hosts
ssh-keyscan "182.92.xxx.xxx" >> ~/.ssh/known_hosts - name: deploy # Deployment
- name: deploy # Deployment run: |
run: | ssh work@182.92.xxx.xxx "
ssh work@182.92.xxx.xxx " # 【Attention】Log in with the 'work' account, manually create /home/work/imooc-lego directory
# 【Attention】Log in with the 'work' account, manually create /home/work/imooc-lego directory # Then git clone https://username:password@github.com/imooc-lego/biz-editor-server.git -b dev (private repository, use GitHub username and password)
# Then git clone https://username:password@github.com/imooc-lego/biz-editor-server.git -b dev (private repository, use GitHub username and password) # Remember to delete origin to avoid exposing GitHub password
# Remember to delete origin to avoid exposing GitHub password cd /home/work/imooc-lego/biz-editor-server;
git remote add origin https://openimbot:${{secrets.WFP_PASSWORD}}@github.com/OpenIMSDK/open-im-server.git;
cd /home/work/imooc-lego/biz-editor-server; git checkout dev;
git remote add origin https://openimbot:${{secrets.WFP_PASSWORD}}@github.com/OpenIMSDK/open-im-server.git; git pull origin dev; # Download the latest code again
git checkout dev; git remote remove origin; # Remove origin to avoid exposing GitHub password
git pull origin dev; # Download the latest code again # Start docker
git remote remove origin; # Remove origin to avoid exposing GitHub password docker-compose build editor-server; # Same as the service name in docker-compose.yml
# Start docker docker-compose up -d;
docker-compose build editor-server; # Same as the service name in docker-compose.yml "
docker-compose up -d; - name: delete ssh key # Delete ssh key
" run: rm -rf ~/.ssh/id_rsa
- name: delete ssh key # Delete ssh key
run: rm -rf ~/.ssh/id_rsa
+2 -2
View File
@@ -126,10 +126,10 @@ api:
# Configuration for Aliyun OSS # Configuration for Aliyun OSS
object: object:
enable: "minio" enable: "minio"
apiURL: "http://127.0.0.1:10002/object/" apiURL: http://113.99.98.99:10002/object/
minio: minio:
bucket: "openim" bucket: "openim"
endpoint: http://127.0.0.1:10005 endpoint: http://113.99.98.99:10005
accessKeyID: root accessKeyID: root
secretAccessKey: openIM123 secretAccessKey: openIM123
sessionToken: "" sessionToken: ""