-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (45 loc) · 1.36 KB
/
Docker_Image_Build.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
name: Docker Image CI
on:
# push:
# branches: [ "main" ]
schedule:
- cron: "0 2 * * *"
workflow_dispatch:
env:
UPDATE: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: check update
run: |
export update=false
chmod 777 check.sh
export update=$(./check.sh)
echo "UPDATE=$update" >> $GITHUB_ENV
- name: Login to DockerHub
if: ${{ env.UPDATE == 'true' }}
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build the Docker image
if: ${{ env.UPDATE == 'true' }}
run: |
docker build . --file Dockerfile --tag captain686/qbittorrent:latest
- name: Push Image To DockerHub
if: ${{ env.UPDATE == 'true' }}
run: docker push captain686/qbittorrent:latest
- name: git push
if: ${{ env.UPDATE == 'true' }}
run: |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
git add .
git commit -m "🚀 $(cat qbittorrent-nox_version)"
- name: push changes
if: ${{ env.UPDATE == 'true' }}
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.PERSONAL_TOKEN }}