-
Notifications
You must be signed in to change notification settings - Fork 77
84 lines (79 loc) · 3 KB
/
check-online-version.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: "Check Online Version"
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
env:
PANEL_PROJECT_NAME: pterodactyl-panel # Dockerhub project
DAEMON_PROJECT_NAME: pterodactyl-daemon
jobs:
get_versions:
name: Get Versions
runs-on: ubuntu-latest
outputs:
current_panel_version: ${{ steps.panel_docker_version.outputs.version }}
current_daemon_version: ${{ steps.daemon_docker_version.outputs.version }}
latest_panel_version: ${{ steps.latest_versions.outputs.panel_version }}
latest_daemon_version: ${{ steps.latest_versions.outputs.daemon_version}}
steps:
- name: Get Current Release
id: latest_versions
run: |
latest_info="$(curl -s "https://cdn.pterodactyl.io/releases/latest.json")"
echo "::set-output name=panel_version::v$(echo $latest_info | jq -r '.panel')"
echo "::set-output name=daemon_version::v$(echo $latest_info | jq -r '.wings')"
- name: Get Panel Docker version
uses: luoqiz/docker-images-latest-version@master
id: panel_docker_version
with:
image: ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.PANEL_PROJECT_NAME }}
- name: Get Daemon Docker version
uses: luoqiz/docker-images-latest-version@master
id: daemon_docker_version
with:
image: ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.DAEMON_PROJECT_NAME }}
update-version-txt:
name: Update version.txt
runs-on: ubuntu-latest
needs: get_versions
if: needs.get_versions.outputs.latest_panel_version != needs.get_versions.outputs.current_panel_version || needs.get_versions.outputs.latest_daemon_version != needs.get_versions.outputs.current_daemon_version
steps:
- uses: actions/checkout@v2
- run: |
git config user.name github-actions
git config user.email [email protected]
echo -e "PANEL_VERSION=${{ needs.get_versions.outputs.latest_panel_version }}\nDAEMON_VERSION=${{ needs.get_versions.outputs.latest_daemon_version }}" > ./manifest/version.txt
git commit -a -m "updated version.txt."
git push
request_daemon_build:
name: Request Daemon Build
runs-on: ubuntu-latest
needs:
- get_versions
- update-version-txt
steps:
- uses: convictional/[email protected]
with:
owner: ${{ github.repository_owner }}
repo: pterodactyl-containers
github_token: ${{ secrets.WORKFLOW_TOKEN }}
workflow_file_name: update-daemon.yml
ref: master
trigger_workflow: true
wait_workflow: false
request_panel_build:
name: Request Panel Build
runs-on: ubuntu-latest
needs:
- get_versions
- update-version-txt
steps:
- uses: convictional/[email protected]
with:
owner: ${{ github.repository_owner }}
repo: pterodactyl-containers
github_token: ${{ secrets.WORKFLOW_TOKEN }}
workflow_file_name: update-panel.yml
ref: master
trigger_workflow: true
wait_workflow: false