-
Notifications
You must be signed in to change notification settings - Fork 111
70 lines (57 loc) · 2 KB
/
docker-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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: Build Docker Images
on:
push:
tags:
- "v*"
env:
IMAGE_NAME: "zmisgod/iptvchecker"
jobs:
docker-build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- run: git fetch --prune --unshallow
- name: Setup Environments
id: envs
run: |
IPTVCHECKER_LATEST_TAG=${{github.ref_name}}
DOCKER_IMAGE=${{ env.IMAGE_NAME }}
echo "RELEASE_VERSION=${GITHUB_REF#refs}"
TAGS="${DOCKER_IMAGE}:latest,${DOCKER_IMAGE}:${IPTVCHECKER_LATEST_TAG}"
echo "IPTVCHECKER_LATEST_TAG:${IPTVCHECKER_LATEST_TAG}"
echo ::set-output name=tags::${TAGS}
mkdir iptv-checker && cp dockerfile iptv-checker/dockerfile
- name: Checkout iptv-checker-rs
uses: actions/checkout@v4
with:
repository: zhimin-dev/iptv-checker-rs
path: ./iptv-checker-rs
token: ${{ secrets.GH_PAT }}
- name: Setup Docker Buildx Command
id: buildx
uses: docker/setup-buildx-action@master
- name: Login to Dockerhub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build Docker Image and Push
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
builder: ${{ steps.buildx.outputs.name }}
context: .
file: iptv-checker/dockerfile
platforms: linux/amd64,linux/arm64,linux/arm/v7
tags: ${{ steps.envs.outputs.tags }}
- name: Update Docker Hub Description
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
repository: ${{ env.IMAGE_NAME }}
short-description: ${{ github.event.repository.description }}
- name: Image Digest
run: echo ${{ steps.docker_build.outputs.digest }}