Skip to content

Update Dockerfile

Update Dockerfile #19

name: xray_docker_reality_docker_image_build
on:
workflow_dispatch:
push:
paths:
- 'reality/Dockerfile'
- '.github/workflows/xray_docker_reality.yml'
- 'reality/entrypoint.sh'
pull_request:
paths:
- 'reality/Dockerfile'
- '.github/workflows/xray_docker_reality.yml'
- 'reality/entrypoint.sh'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
- name: Docker Setup Buildx
uses: docker/[email protected]
- name: Docker Login
uses: docker/[email protected]
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/[email protected]
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