diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 3751f59..04a6ffd 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -14,7 +14,6 @@ name: "CodeQL" on: push: branches: [ "main" ] - tags: [ "v*.*.*" ] pull_request: # The branches below must be a subset of the branches above branches: [ "main" ] diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..4b5f0cd --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,29 @@ +name: Publish +on: + push: + tags: + - '*' +env: + REGISTRY: docker.io + USERNAME: lansongxx + IMAGE_NAME: cloudmind-system +jobs: + publish: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Setup Kubectl + uses: azure/setup-kubectl@v3 + with: + version: ${{ vars.KUBE_VERSION }} + + - name: Deploy + run: | + TAG_NAME="${GITHUB_REF#refs/tags/}" + mkdir $HOME/.kube + echo "${{ secrets.KUBE_CONFIG }}" > $HOME/.kube/config + kubectl get deployment ${{ env.IMAGE_NAME }} -n ${{ vars.BASE_NAMESPACE }} -o yaml |\ + sed "s|^\( - image: ${USERNAME}/${IMAGE_NAME}:\).*\$|\1${TAG_NAME}|" |\ + kubectl apply -f - \ No newline at end of file diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 010aafd..e8b0b13 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -2,7 +2,6 @@ name: CI on: push: branches: [ "main" ] - tags: [ "v*.*.*" ] pull_request: branches: [ "main" ] diff --git a/.github/workflows/upgrade.yml b/.github/workflows/upgrade.yml index 8b14c40..5b3929d 100644 --- a/.github/workflows/upgrade.yml +++ b/.github/workflows/upgrade.yml @@ -7,8 +7,6 @@ name: Upgrade on: push: - # Publish semver tags as releases. - tags: [ 'v*.*.*' ] branches: [ "main" ] pull_request: branches: [ "main" ]