Add GHA workflow to upload kickstart script to our repo server. (#16724)
This will be used for hosting of the script going forwards. Further changes will need to happen on the system itself to put the script in the right place and ensure it gets served properly.
Austin S. Hemmelgarn committed
Jan 4, 2024 at 08:55 UTC
aba8f39359f8e3b5c30643b8932eb4d16d2d1ff9
1 file changed
+54
.github/workflows/kickstart-upload.yml
new
+54
@@ -0,0 +1,54 @@
1
+---
2
+# Upload the kickstart script to the repo server
3
+name: Upload Kickstart Script
4
+on:
5
+ push:
6
+ branches:
7
+ - master
8
+ paths:
9
+ - .github/workflows/kickstart-upload.yml
10
+ - packaging/installer/kickstart.sh
11
+ workflow_dispatch: null
12
+concurrency:
13
+ group: kickstart-upload
14
+ cancel-in-progress: true
15
+jobs:
16
+ upload:
17
+ name: Upload Kickstart Script
18
+ runs-on: ubuntu-latest
19
+ if: github.repository == 'netdata/netdata'
20
+ steps:
21
+ - name: Checkout
22
+ id: checkout
23
+ uses: actions/checkout@v4
24
+ with:
25
+ fetch-depth: 1
26
+ - name: SSH setup
27
+ id: ssh-setup
28
+ uses: shimataro/ssh-key-action@v2
29
+ with:
30
+ key: ${{ secrets.NETDATABOT_PACKAGES_SSH_KEY }}
31
+ name: id_ecdsa
32
+ known_hosts: ${{ secrets.PACKAGES_KNOWN_HOSTS }}
33
+ - name: Upload
34
+ id: upload
35
+ run: rsync -vp packaging/installer/kickstart.sh netdatabot@packages.netdata.cloud:/home/netdatabot/incoming/kickstart.sh
36
+ - name: Failure Notification
37
+ uses: rtCamp/action-slack-notify@v2
38
+ env:
39
+ SLACK_COLOR: 'danger'
40
+ SLACK_ICON_EMOJI: ':github-actions:'
41
+ SLACK_TITLE: 'Kickstart upload failed:'
42
+ SLACK_USERNAME: 'GitHub Actions'
43
+ SLACK_MESSAGE: |-
44
+ ${{ github.repository }}: Failed to upload updated kickstart script to repo server.
45
+ Checkout: ${{ steps.checkout.outcome }}
46
+ Import SSH Key: ${{ steps.ssh-setup.outcome }}
47
+ Upload: ${{ steps.upload.outcome }}
48
+ SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
49
+ if: >-
50
+ ${{
51
+ failure()
52
+ && startsWith(github.ref, 'refs/heads/master')
53
+ && github.repository == 'netdata/netdata'
54
+ }}