xray_docker_reality_docker_image_build #30
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: xray_docker_reality_docker_image_build | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 20 */2 * *' # UTC 20:00 UTC+8 04:00 | |
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-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Docker Setup Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Docker Login | |
uses: docker/login-action@v3 | |
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: Get latest Xray-core version (including pre-release) | |
run: | | |
LATEST_VERSION=$(curl -s https://api.github.com/repos/XTLS/Xray-core/releases | jq -r '.[0].tag_name') | |
echo "XRAY_VERSION=$LATEST_VERSION" >> $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}}-ubuntu-22.04-xray-${{env.XRAY_VERSION}} | |
wulabing/xray_docker_reality:latest | |
push: true |