-
Notifications
You must be signed in to change notification settings - Fork 388
67 lines (57 loc) · 1.87 KB
/
docker-publish.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
# _ _ ____ ____
# / \ _ __(_) __ _|___ \ | _ \ _ __ ___
# / _ \ | '__| |/ _` | __) | | |_) | '__/ _ \
# / ___ \| | | | (_| |/ __/ | __/| | | (_) |
# /_/ \_\_| |_|\__,_|_____| |_| |_| \___/
#
# https://github.com/P3TERX/Aria2-Pro-Docker
#
# Copyright (c) 2020-2021 P3TERX <https://p3terx.com>
#
# This is free software, licensed under the MIT License.
# See /LICENSE for more information.
name: Docker Images Publish
on:
workflow_dispatch:
repository_dispatch:
jobs:
publish:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}
- name: Marker version and time
id: getVersion
run: |
sed -i "s@COMMIT_HASH@$(git rev-parse --short HEAD)@" rootfs/Aria2-Pro
sed -i "s@DATE_TIME@$(date +"%Y/%m/%d %H:%M")@" rootfs/Aria2-Pro
cat rootfs/Aria2-Pro
echo "::set-output name=time::$(date +"%Y%m%d%H%M")"
- name: Build and push
uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/386,linux/arm64,linux/arm/v7,linux/arm/v6
file: Dockerfile
context: .
push: true
tags: |
p3terx/aria2-pro
ghcr.io/p3terx/aria2-pro
p3terx/aria2-pro:${{ steps.getVersion.outputs.time }}
ghcr.io/p3terx/aria2-pro:${{ steps.getVersion.outputs.time }}