Files
v2rayA/.github/workflows/dockerimage.yml
T

36 lines
1.0 KiB
YAML

name: v2raya-docker
on:
push:
tags:
- v*
env:
DOCKER_CLI_EXPERIMENTAL: enabled
DOCKER_BUILDKIT: 1
jobs:
build:
strategy:
fail-fast: false
matrix:
platform: [linux/arm, linux/arm64,linux/amd64]
runs-on: ubuntu-latest
env:
PLATFORM: ${{ matrix.platform }}
steps:
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)
- uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build the Docker image
run: |
docker login -u ${{secrets.DOCKER_USERNAME}} -p ${{secrets.DOCKER_PASSWORD}}
v=$(echo ${{ steps.get_version.outputs.VERSION }} | cut -c2-)
docker buildx build -t mzz2017/v2raya:$v -f Dockerfile --platform="$PLATFORM" . --push
docker buildx build -t mzz2017/v2raya:latest -f Dockerfile --platform="$PLATFORM" . --push