This repository has been archived by the owner on Aug 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (71 loc) · 2.15 KB
/
ci.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
name: ci
on:
push:
branches:
- 'main'
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
inputs:
manual_trigger:
description: 'Manually trigger the workflow'
default: 'true'
required: false
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get latest Flexget release
id: get_release
run: |
latest_release=$(curl -s https://api.github.com/repos/Flexget/Flexget/releases/latest | jq -r '.tag_name')
echo "TAG_NAME=$latest_release" >> $GITHUB_ENV
- name: Compare with stored release
id: compare_release
run: |
stored_release=$(cat stored_release.txt 2>/dev/null || echo "")
latest_release=$TAG_NAME
if [ "$stored_release" != "$latest_release" ]; then
echo "New release detected: $latest_release"
echo "$latest_release" > stored_release.txt
else
echo "No new release found. Exiting."
exit 0
fi
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v6
env:
Ver: $TAG_NAME
with:
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/flexget:latest
${{ secrets.DOCKERHUB_USERNAME }}/flexget:"$Ver"
- name: Set up Git
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"
- name: Make changes to repository
run: |
git add ./stored_release.txt
git commit -m "Update $TAG_NAME"
- name: Push changes back to repository
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git push origin main