Create .github/workflows/xray_docker_reality.yml
This commit is contained in:
parent
a4602771cb
commit
e0ddbedc00
49
.github/workflows/xray_docker_reality.yml
vendored
Normal file
49
.github/workflows/xray_docker_reality.yml
vendored
Normal file
@ -0,0 +1,49 @@
|
||||
name: xray_docker_reality_docker_image_build
|
||||
|
||||
on:
|
||||
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 the Docker image latest
|
||||
run: docker build --file Dockerfile --tag wulabing/xray_docker_reality:latest ./xray_docker/reality
|
||||
|
||||
- name: Build the Docker image
|
||||
run: docker build --file Dockerfile --tag wulabing/xray_docker_reality:${{env.TAG_NAME}} ./xray_docker/reality
|
||||
|
||||
- name: Push the Docker image latest
|
||||
run: docker push wulabing/xray_docker_reality:latest
|
||||
- name: Push the Docker image
|
||||
run: docker push wulabing/xray_docker_reality:${{env.TAG_NAME}}
|
||||
Loading…
Reference in New Issue
Block a user