56 lines
1.5 KiB
YAML
56 lines
1.5 KiB
YAML
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
|