mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-22 10:08:15 -05:00
Refactor docker.yaml
This commit is contained in:
parent
168675a61b
commit
964d0fbbbe
35
.github/workflows/docker.yaml
vendored
35
.github/workflows/docker.yaml
vendored
@ -28,43 +28,16 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
echo "${DOCKER_PASSWORD}" | docker login --username ${DOCKER_USERNAME} --password-stdin
|
echo "${DOCKER_PASSWORD}" | docker login --username ${DOCKER_USERNAME} --password-stdin
|
||||||
|
|
||||||
- name: Get image version
|
- name: Build and push Docker image
|
||||||
id: get_image_version
|
|
||||||
run: echo ::set-output name=version::${GITHUB_REF#refs/*/}
|
|
||||||
|
|
||||||
- name: Get image name
|
|
||||||
id: get_image_name
|
|
||||||
env:
|
env:
|
||||||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
||||||
run: echo ::set-output name=name::$(echo $DOCKER_USERNAME | tr '[:upper:]' '[:lower:]')/v2fly-core
|
DOCKER_IMAGE_PLATFORM: linux/386,linux/amd64,linux/arm/v7,linux/arm64
|
||||||
|
|
||||||
- name: Get image platform
|
|
||||||
env:
|
|
||||||
PLATFORM: linux/386,linux/amd64,linux/arm/v7,linux/arm64
|
|
||||||
id: get_image_platform
|
|
||||||
run: echo ::set-output name=platform::"$PLATFORM"
|
|
||||||
|
|
||||||
- name: Build and push Docker image (version)
|
|
||||||
env:
|
|
||||||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
|
||||||
DOCKER_IMAGE_NAME: ${{ steps.get_image_name.outputs.name }}
|
|
||||||
DOCKER_IMAGE_VERSION: ${{ steps.get_image_version.outputs.version }}
|
|
||||||
DOCKER_IMAGE_PLATFORM: ${{ steps.get_image_platform.outputs.platform }}
|
|
||||||
run: |
|
run: |
|
||||||
|
DOCKER_IMAGE_NAME=$(echo $DOCKER_USERNAME | tr '[:upper:]' '[:lower:]')/v2fly-core
|
||||||
|
DOCKER_IMAGE_VERSION=${GITHUB_REF#refs/*/}
|
||||||
docker buildx build \
|
docker buildx build \
|
||||||
--platform "$DOCKER_IMAGE_PLATFORM" \
|
--platform "$DOCKER_IMAGE_PLATFORM" \
|
||||||
--output "type=image,push=true" \
|
--output "type=image,push=true" \
|
||||||
--tag "$DOCKER_IMAGE_NAME":"$DOCKER_IMAGE_VERSION" \
|
--tag "$DOCKER_IMAGE_NAME":"$DOCKER_IMAGE_VERSION" \
|
||||||
--file ./Dockerfile .
|
|
||||||
|
|
||||||
- name: Build and push Docker image (latest)
|
|
||||||
env:
|
|
||||||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
|
||||||
DOCKER_IMAGE_NAME: ${{ steps.get_image_name.outputs.name }}
|
|
||||||
DOCKER_IMAGE_PLATFORM: ${{ steps.get_image_platform.outputs.platform }}
|
|
||||||
run: |
|
|
||||||
docker buildx build \
|
|
||||||
--platform "$DOCKER_IMAGE_PLATFORM" \
|
|
||||||
--output "type=image,push=true" \
|
|
||||||
--tag "$DOCKER_IMAGE_NAME":latest \
|
--tag "$DOCKER_IMAGE_NAME":latest \
|
||||||
--file ./Dockerfile .
|
--file ./Dockerfile .
|
||||||
|
Loading…
Reference in New Issue
Block a user