Merge pull request #229 from AriaAto/master #223
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
name: ci | |
on: | |
push: | |
branches: | |
- 'master' | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: openv2x/omega:latest | |
build-args: | | |
GIT_BRANCH=${{ github.ref_name }} | |
REPO_URL=https://github.com/open-v2x/omega | |
GIT_COMMIT=${{ github.sha }} | |
acr: | |
needs: docker | |
runs-on: ubuntu-latest | |
steps: | |
- name: sync image to ACR | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.FQ_HOST }} | |
username: ${{ secrets.FQ_USERNAME }} | |
key: ${{ secrets.FQ_KEY }} | |
port: ${{ secrets.FQ_PORT }} | |
script: | | |
set -e | |
(docker images | grep none | awk '{print $3}' | xargs -I{} docker rmi -f {}) || true | |
docker pull openv2x/omega:latest | |
docker tag openv2x/omega:latest registry.cn-shanghai.aliyuncs.com/openv2x/omega:latest | |
docker push registry.cn-shanghai.aliyuncs.com/openv2x/omega:latest | |
ssh: | |
needs: acr | |
runs-on: ubuntu-latest | |
steps: | |
- name: apply to all-in-one environment | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.AIO_MASTER_HOST }} | |
username: ${{ secrets.AIO_MASTER_USERNAME }} | |
key: ${{ secrets.AIO_MASTER_KEY }} | |
port: ${{ secrets.AIO_MASTER_PORT }} | |
script: | | |
set -e | |
rm -rf openv2x-aio-master.tar.gz && wget https://openv2x.oss-ap-southeast-1.aliyuncs.com/deploy/master/openv2x-aio-master.tar.gz | |
rm -rf src && tar zxvf openv2x-aio-master.tar.gz | |
cd src | |
sh install.sh |