name: xray_docker_reality_docker_image_build on: workflow_dispatch: push: paths: - 'reality/Dockerfile' - '.github/workflows/xray_docker_reality.yml' - 'reality/entrypoin.sh' pull_request: paths: - 'reality/Dockerfile' - '.github/workflows/xray_docker_reality.yml' - 'reality/entrypoin.sh' jobs: build: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v3.4.0 - name: Docker Setup Buildx uses: docker/setup-buildx-action@v2.5.0 - name: Docker Login uses: docker/login-action@v2.1.0 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - name: Extract first line of commit message shell: bash run: | COMMIT_MESSAGE=$(git log --format=%B -n 1 ${{ github.sha }}) FIRST_LINE=$(echo "$COMMIT_MESSAGE" | head -n1) TAG_NAME=$(echo "$FIRST_LINE" | tr -d '[:space:]') # Remove spaces if needed echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV - name: Build and push Docker image uses: docker/build-push-action@v4.0.0 with: context: ./reality file: ./reality/Dockerfile platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 tags: | wulabing/xray_docker_reality:${{env.TAG_NAME}} wulabing/xray_docker_reality:latest push: true