forked from Jrohy/trojan
-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (45 loc) · 1.47 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
name: Docker
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
on:
workflow_dispatch: #github页面手动触发
push:
tags: [ 'v*' ]
env:
# github.repository as <account>/<repo>
IMAGE_NAME: jrohy/trojan
jobs:
buildx:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Get latest tag
uses: oprypin/find-latest-tag@v1
id: octokit # The step ID to refer to later.
with:
repository: ${{ github.repository }} # The repository to scan.
# https://github.com/docker/login-action
- name: Login
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# https://github.com/docker/build-push-action
- name: Build & Push
uses: docker/build-push-action@v2
with:
context: .
file: ./asset/Dockerfile
platforms: linux/amd64,linux/arm64/v8
push: true
tags: |
${{ env.IMAGE_NAME }}:${{ steps.octokit.outputs.tag }}
${{ env.IMAGE_NAME }}:latest