Update dongtai-worker-report-only.yaml #1406
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: Deploy DongTai Server To Dev | |
on: | |
push: | |
branches: | |
- main | |
- beta | |
- develop | |
workflow_dispatch: | |
inputs: | |
agent_version: | |
required: true | |
type: string | |
jobs: | |
Deploy-to-dev: | |
if: ${{ github.event_name == 'workflow_dispatch' || github.repository_owner == 'HXSecurity' }} | |
runs-on: ubuntu-latest | |
strategy: | |
max-parallel: 4 | |
matrix: | |
python-version: [3.7] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Get the release version | |
id: version | |
run: echo ::set-output name=GITHUB_REF::${GITHUB_REF##*/} | |
- name: Setup QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Setup Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to Aliyun Registry | |
uses: docker/login-action@v1 | |
with: | |
registry: ${{ secrets.TEN_REGISTRY }} | |
username: ${{ secrets.TEN_DOCKERHUB_USER }} | |
password: ${{ secrets.TEN_DOCKERHUB_PASSWORD }} | |
- name: Generate version file | |
run: | | |
#bash .github/workflows/config_update.sh | |
#bash .github/workflows/config_update.sh "${{ steps.release.outputs.VERSION }}" | |
- name: Upload COS | |
if: ${{ steps.version.outputs.GITHUB_REF }} == develop | |
uses: zkqiang/tencent-cos-action@v0.1.0 | |
with: | |
args: download -rs /agent_test/java/latest/ ./ --include "*.jar" | |
secret_id: ${{ secrets.TENSECRET_ID }} | |
secret_key: ${{ secrets.TENSECRET_KEY }} | |
bucket: dongtai-helm-charts-1251882848 | |
region: ap-hongkong | |
- name: Generate version file | |
run: | | |
echo "REPLACE INTO project_version_control (version, component_name, component_version_hash) VALUES('${{ github.run_number }}.0.0', '${{ github.event.repository.name }}', '${GITHUB_SHA}');" >> ./deploy/docker/version.sql | |
- name: Build and push | |
uses: docker/build-push-action@v3 | |
with: | |
file: Dockerfile | |
context: . | |
push: true | |
platforms: linux/amd64 | |
tags: | | |
wukong.tencentcloudcr.com/dongtai/dongtai-server:${{ steps.version.outputs.GITHUB_REF }}-latest | |
wukong.tencentcloudcr.com/dongtai/dongtai-server:${{ steps.version.outputs.GITHUB_REF }}-1.0.${{github.run_number}} | |
- name: deploy to cluster | |
uses: HXSecurity/kubectl-helm-action@main | |
env: | |
MAX: false | |
PROJECT: server | |
TOKEN_SCA: ${{ secrets.TOKEN_SCA }} | |
KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_TEST_DATA }} |