Repository navigation
56 lines (49 loc) · 1.42 KB
/
Copy pathddns.yml
File metadata and controls
56 lines (49 loc) · 1.42 KB
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
name: 构建镜像:ddns
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
name: 构建镜像:ddns
env:
IMAGE_NAME: ddns
steps:
-
name: Checkout
uses: actions/checkout@master
-
name: Prepare
id: prepare
run: |
version=$(curl -s https://api.github.com/repos/NewFuture/DDNS/releases/latest | jq -r .tag_name | sed "s/v//")
echo ::set-output name=version::${version}
-
name: Set Up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set Up Buildx
uses: docker/setup-buildx-action@v2
-
name: Login DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
-
name: Set Up Cache
uses: actions/cache@v2
id: buildx-cache
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx
-
name: Buildx
uses: docker/build-push-action@v3
with:
context: ${{ env.IMAGE_NAME }}
file: ${{ env.IMAGE_NAME }}/Dockerfile
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: |
${{ secrets.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}:${{ steps.prepare.outputs.version }}
${{ secrets.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}:latest