-
Notifications
You must be signed in to change notification settings - Fork 747
59 lines (51 loc) · 1.81 KB
/
deploy-weekly.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Deploy-Weekly
on:
schedule:
- cron: '0 20 * * 6'
workflow_dispatch:
jobs:
Deploy-Weekly:
runs-on: ubuntu-latest
timeout-minutes: 150
if: github.repository == 'kubesphere/ks-installer'
strategy:
max-parallel: 1
env:
working-directory: ./.github/workflows/deploy-weekly
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_TEST }}
steps:
- uses: actions/[email protected]
- name: setup terraform
working-directory: ${{env.working-directory}}
run: |
wget https://releases.hashicorp.com/terraform/0.13.0/terraform_0.13.0_linux_amd64.zip
unzip terraform_0.13.0_linux_amd64.zip
- name: setup secret
working-directory: ${{env.working-directory}}
run: |
sed -i 's/QING_ACCESS_KEY/${{ secrets.QINGCLOUD_ACCESS_KEY }}/g' var.tf
sed -i 's/QING_SECRET_KEY/${{ secrets.QINGCLOUD_SECRET_KEY }}/g' var.tf
sed -i 's/QING_EIP_ID/${{ secrets.QING_EIP_ID }}/g' var.tf
sed -i 's/QING_EIP/${{ secrets.QING_EIP }}/g' var.tf
sed -i 's/QING_PASSWORD/${{ secrets.QING_PASSWORD }}/g' var.tf
sed -i 's/GITHUB_REPOSITORY/${{ github.repository_owner }}-tf-cd-allinone/g' var.tf
- name: init
working-directory: ${{env.working-directory}}
run: |
terraform init
- name: destory
continue-on-error: true
working-directory: ${{env.working-directory}}
run: |
echo 'yes' | terraform destroy
- name: install kubesphere
working-directory: ${{env.working-directory}}
timeout-minutes: 90
run: |
terraform apply -input=false -auto-approve
- name: slack
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
fields: repo,message,commit,author,action,eventName,ref,workflow,job,took
if: ${{ failure() }}