mirror of
https://github.com/xjasonlyu/tun2socks.git
synced 2024-12-30 02:37:01 +00:00
50 lines
1.2 KiB
YAML
50 lines
1.2 KiB
YAML
name: Publish Docker Image
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
paths-ignore:
|
|
- '.github/**'
|
|
- '.gitignore'
|
|
- 'README.md'
|
|
|
|
jobs:
|
|
|
|
build:
|
|
name: Build
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
|
|
- name: Check out code into the Go module directory
|
|
uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v1
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
- name: Login to DockerHub
|
|
uses: docker/login-action@v1
|
|
with:
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
- name: Get Version
|
|
id: shell
|
|
run: |
|
|
echo ::set-output name=version::$(git describe --tags --long | cut -c 2-)
|
|
|
|
- name: Build and Push
|
|
if: github.ref == 'refs/heads/master'
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
push: true
|
|
platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64
|
|
tags: |
|
|
xjasonlyu/tun2socks:latest
|
|
xjasonlyu/tun2socks:${{ steps.shell.outputs.version }}
|