-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
yuanjunjie
committed
Jul 3, 2024
1 parent
2f602f0
commit 5c1ce77
Showing
1 changed file
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: ['master'] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Build Client docker | ||
run: | | ||
docker build -t vue-vben-admin:dev ./vue-vben-admin/ | ||
- name: Login to Docker Registry | ||
run: docker login -u ${{ secrets.HUAWEI_CLOUD_USERNAME }} -p ${{ secrets.HUAWEI_CLOUD_PASSWORD }} swr.cn-north-4.myhuaweicloud.com | ||
|
||
- name: Push to Docker Registry | ||
run: | | ||
docker tag vue-vben-admin:dev swr.cn-north-4.myhuaweicloud.com/yuanjunjie/vue-vben-admin:dev | ||
docker push swr.cn-north-4.myhuaweicloud.com/yuanjunjie/vue-vben-admin:dev | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Build Server docker | ||
run: | | ||
docker build -t nest-admin:dev ./nest-admin/servers/ | ||
- name: Login to Docker Registry | ||
run: docker login -u ${{ secrets.HUAWEI_CLOUD_USERNAME }} -p ${{ secrets.HUAWEI_CLOUD_PASSWORD }} swr.cn-north-4.myhuaweicloud.com | ||
|
||
- name: Push to Docker Registry | ||
run: | | ||
docker tag nest-admin:dev swr.cn-north-4.myhuaweicloud.com/yuanjunjie/nest-admin:dev | ||
docker push swr.cn-north-4.myhuaweicloud.com/yuanjunjie/nest-admin:dev | ||
deploy: | ||
needs: [build] | ||
name: Deploy | ||
runs-on: fd-dev | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Update docker images | ||
run: | | ||
sudo su | ||
docker pull swr.cn-north-4.myhuaweicloud.com/yuanjunjie/vue-vben-admin:dev | ||
docker pull swr.cn-north-4.myhuaweicloud.com/yuanjunjie/nest-admin:dev | ||
- name: Login to Docker Registry | ||
run: | | ||
sudo su | ||
docker login -u ${{ secrets.HUAWEI_CLOUD_USERNAME }} -p ${{ secrets.HUAWEI_CLOUD_PASSWORD }} swr.cn-north-4.myhuaweicloud.com | ||
- name: Run | ||
run: | | ||
sudo su | ||
docker compose -f docker-compose.yml up -d | ||
- name: Clear Docker Cache | ||
run: | | ||
sudo su | ||
sudo docker image prune -f | ||
sudo docker volume prune -f |