github.com/xtls/xray-core@v1.8.12-0.20240518155711-3168d27b0bdb/.github/workflows/docker.yml (about)

     1  name: Build docker image
     2  
     3  on:
     4    push:
     5      branches:
     6        - main
     7  
     8  jobs:
     9    build-image:
    10      runs-on: ubuntu-latest
    11      permissions:
    12        packages: write
    13      steps:
    14        - uses: actions/checkout@v4
    15        - name: Docker metadata
    16          id: meta
    17          uses: docker/metadata-action@v5
    18          with:
    19            images: ghcr.io/${{ github.repository_owner }}/xray-core
    20            flavor: latest=true
    21            tags: |
    22              type=ref,event=branch
    23              type=ref,event=pr
    24              type=semver,pattern={{version}}
    25        - name: Login to GitHub Container Registry
    26          uses: docker/login-action@v3
    27          with:
    28            registry: ghcr.io
    29            username: ${{ github.repository_owner }}
    30            password: ${{ secrets.GITHUB_TOKEN }}
    31        - # Add support for more platforms with QEMU (optional)
    32          # https://github.com/docker/setup-qemu-action
    33          name: Set up QEMU
    34          uses: docker/setup-qemu-action@v3
    35        - name: Set up Docker Buildx
    36          uses: docker/setup-buildx-action@v3
    37        - name: Build and push
    38          uses: docker/build-push-action@v5
    39          with:
    40            context: .
    41            platforms: linux/amd64,linux/arm64
    42            file: .github/docker/Dockerfile
    43            push: true
    44            tags: ${{ steps.meta.outputs.tags }}
    45            labels: ${{ steps.meta.outputs.labels }}