mirror of
https://github.com/xjasonlyu/tun2socks.git
synced 2025-10-20 15:35:45 +08:00
Update docker.yml
This commit is contained in:
41
.github/workflows/docker.yml
vendored
41
.github/workflows/docker.yml
vendored
@@ -1,8 +1,14 @@
|
|||||||
name: Publish Docker Image
|
name: Publish Docker Image
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
paths-ignore:
|
||||||
|
- '.github/**'
|
||||||
|
- '.gitignore'
|
||||||
|
- 'README.md'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
build:
|
build:
|
||||||
@@ -15,22 +21,29 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Set up docker buildx
|
- name: Set up QEMU
|
||||||
id: buildx
|
uses: docker/setup-qemu-action@v1
|
||||||
uses: crazy-max/ghaction-docker-buildx@v3
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v1
|
||||||
|
|
||||||
|
- name: Login to DockerHub
|
||||||
|
uses: docker/login-action@v1
|
||||||
with:
|
with:
|
||||||
buildx-version: latest
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
qemu-version: latest
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
|
||||||
- name: Docker login
|
- name: Get Version
|
||||||
env:
|
id: shell
|
||||||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
|
||||||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
|
||||||
run: |
|
run: |
|
||||||
echo "${DOCKER_PASSWORD}" | docker login --username "${DOCKER_USERNAME}" --password-stdin
|
echo ::set-output name=version::$(git describe --tags --long | cut -c 2-)
|
||||||
|
|
||||||
- name: Docker buildx image and push on master branch
|
- name: Build and Push
|
||||||
if: github.ref == 'refs/heads/master'
|
if: github.ref == 'refs/heads/master'
|
||||||
run: |
|
uses: docker/build-push-action@v2
|
||||||
docker buildx build --output "type=image,push=true" --platform=linux/amd64,linux/arm/v7,linux/arm64 --tag xjasonlyu/tun2socks:$(git describe --tags --long | cut -c 2-) .
|
with:
|
||||||
docker buildx build --output "type=image,push=true" --platform=linux/amd64,linux/arm/v7,linux/arm64 --tag xjasonlyu/tun2socks:latest .
|
push: true
|
||||||
|
platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64
|
||||||
|
tags: |
|
||||||
|
xjasonlyu/tun2socks:latest
|
||||||
|
xjasonlyu/tun2socks:${{ steps.shell.outputs.version }}
|
||||||
|
Reference in New Issue
Block a user