-
Notifications
You must be signed in to change notification settings - Fork 43
98 lines (82 loc) · 2.76 KB
/
docker-image.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: Docker Image CI
on:
workflow_dispatch:
push:
branches:
- master
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '0 0 * * *'
jobs:
build:
runs-on: 'ubuntu-latest'
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
if: github.event_name != 'push'
with:
platforms: arm64
- name: Check Out Repo
uses: actions/checkout@v3
- name: Check Out Repo Invidious
uses: actions/checkout@v3
with:
repository: "iv-org/invidious"
ref: 'master'
path: 'invidious'
- name: patch invidious main repo
run: |
cd invidious
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
git am ../patches/*.patch
sed -i 's/https:\/\/invidious.io\/donate\//\/donate/g' src/invidious/views/template.ecr
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Set up build commit id
run: echo "commitid=$(cd invidious && git log --format="%H" -n 1)-$(git log --format="%H" -n 1)" >> $GITHUB_ENV
- name: Build and push alpine docker image
id: docker_build_new
uses: docker/build-push-action@v3
with:
context: ./
file: ./Dockerfile.new
build-args: |
release=1
platforms: linux/arm64/v8
push: true
tags: unixfox/invidious-custom:new-latest, unixfox/invidious-custom:new-build-${{ env.commitid }}
# - name: patch invidious API repo
# run: |
# cd invidious
# git config --global user.email "[email protected]"
# git config --global user.name "Your Name"
# git am ../patches-api/*.patch
# - name: Build and push alpine docker image with API only
# id: docker_build_new_api
# uses: docker/build-push-action@v3
# with:
# context: ./
# file: ./Dockerfile.new
# build-args: |
# release=1
# add_build_args=-Dapi_only
# platforms: linux/amd64,linux/arm64/v8
# push: true
# tags: unixfox/invidious-custom:api-new-latest, unixfox/invidious-custom:api-new-build-${{ env.commitid }}
# - name: Build and push official crystal docker image
# id: docker_build
# uses: docker/build-push-action@v3
# with:
# context: ./
# build-args: |
# release=1
# file: ./Dockerfile
# push: true
# tags: unixfox/invidious-custom:latest, unixfox/invidious-custom:build-${{ env.commitid }}