mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-12-12 16:23:56 +03:00
2f6c4e3696
Co-authored-by: Hongtao Lye <codert.sn@gmail.com> Co-authored-by: liuyi <forehalo@gmail.com> Co-authored-by: LongYinan <lynweklm@gmail.com> Co-authored-by: X1a0t <405028157@qq.com> Co-authored-by: JimmFly <yangjinfei001@gmail.com> Co-authored-by: Peng Xiao <pengxiao@outlook.com> Co-authored-by: xiaodong zuo <53252747+zuoxiaodong0815@users.noreply.github.com> Co-authored-by: DarkSky <25152247+darkskygit@users.noreply.github.com> Co-authored-by: Qi <474021214@qq.com> Co-authored-by: danielchim <kahungchim@gmail.com>
51 lines
1.6 KiB
YAML
51 lines
1.6 KiB
YAML
name: 'Deploy to Cluster'
|
|
description: 'Deploy AFFiNE Cloud to cluster'
|
|
inputs:
|
|
build-type:
|
|
description: 'Align with App build type, canary|beta|stable|internal'
|
|
default: 'canary'
|
|
gcp-project-number:
|
|
description: 'GCP project number'
|
|
required: true
|
|
gcp-project-id:
|
|
description: 'GCP project id'
|
|
required: true
|
|
service-account:
|
|
description: 'Service account'
|
|
cluster-name:
|
|
description: 'Cluster name'
|
|
cluster-location:
|
|
description: 'Cluster location'
|
|
|
|
runs:
|
|
using: 'composite'
|
|
steps:
|
|
- name: Setup Git short hash
|
|
shell: bash
|
|
run: |
|
|
echo "GIT_SHORT_HASH=$(git rev-parse --short HEAD)" >> "$GITHUB_ENV"
|
|
- uses: azure/setup-helm@v3
|
|
- id: auth
|
|
uses: google-github-actions/auth@v1
|
|
with:
|
|
workload_identity_provider: 'projects/${{ inputs.gcp-project-number }}/locations/global/workloadIdentityPools/github-actions/providers/github-actions-helm-deploy'
|
|
service_account: '${{ inputs.service-account }}'
|
|
token_format: 'access_token'
|
|
project_id: '${{ inputs.gcp-project-id }}'
|
|
|
|
- name: 'Setup gcloud cli'
|
|
uses: 'google-github-actions/setup-gcloud@v1'
|
|
with:
|
|
install_components: 'gke-gcloud-auth-plugin'
|
|
|
|
- id: get-gke-credentials
|
|
shell: bash
|
|
run: |
|
|
gcloud container clusters get-credentials ${{ inputs.cluster-name }} --region ${{ inputs.cluster-location }} --project ${{ inputs.gcp-project-id }}
|
|
|
|
- name: Deploy
|
|
shell: bash
|
|
run: node ./.github/actions/deploy/deploy.mjs
|
|
env:
|
|
BUILD_TYPE: '${{ inputs.build-type }}'
|