1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-11-19 02:46:33 -05:00
v2fly/.github/workflows/docker.yaml

44 lines
1.5 KiB
YAML
Raw Normal View History

2020-07-24 00:37:33 -04:00
name: Release Docker Image
2020-07-23 09:31:47 -04:00
on:
push:
tags:
- v*
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Set up Checkout
uses: actions/checkout@v2
2020-07-24 00:37:33 -04:00
- name: Install Buildx and QEMU
run: |
export DOCKER_BUILDKIT=1
docker build --platform=local -o . git://github.com/docker/buildx
mkdir -p ~/.docker/cli-plugins
mv buildx ~/.docker/cli-plugins/docker-buildx
docker run --rm --privileged multiarch/qemu-user-static:latest --reset -p yes --credential yes
docker buildx create --use --name build --node build --driver-opt network=host
2020-07-23 09:31:47 -04:00
2020-07-24 00:37:33 -04:00
- name: Log in to Docker Hub
2020-07-23 09:31:47 -04:00
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: |
echo "${DOCKER_PASSWORD}" | docker login --username ${DOCKER_USERNAME} --password-stdin
2020-07-24 01:32:10 -04:00
- name: Build and push Docker image
2020-07-23 09:31:47 -04:00
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
2020-07-24 01:32:10 -04:00
DOCKER_IMAGE_PLATFORM: linux/386,linux/amd64,linux/arm/v7,linux/arm64
2020-07-23 09:31:47 -04:00
run: |
2020-07-24 01:32:10 -04:00
DOCKER_IMAGE_NAME=$(echo $DOCKER_USERNAME | tr '[:upper:]' '[:lower:]')/v2fly-core
DOCKER_IMAGE_VERSION=${GITHUB_REF#refs/*/}
2020-07-23 09:31:47 -04:00
docker buildx build \
2020-07-24 00:37:33 -04:00
--platform "$DOCKER_IMAGE_PLATFORM" \
2020-07-23 09:31:47 -04:00
--output "type=image,push=true" \
2020-07-24 00:37:33 -04:00
--tag "$DOCKER_IMAGE_NAME":"$DOCKER_IMAGE_VERSION" \
--tag "$DOCKER_IMAGE_NAME":latest \
2020-07-23 09:31:47 -04:00
--file ./Dockerfile .