github.com/ipfans/trojan-go@v0.11.0/.github/workflows/docker-nightly-build.yml (about)

     1  on:
     2    push:
     3      branches:
     4        - master
     5      paths-ignore:
     6        - '**.md'
     7        - 'docs/**'
     8  name: docker-nightly-build
     9  jobs:
    10    build:
    11      if: github.repository == 'p4gefau1t/trojan-go'
    12      runs-on: ubuntu-latest
    13      steps:
    14        - name: Checkout the code
    15          uses: actions/checkout@v2
    16  
    17        - name: Setup QEMU
    18          uses: docker/setup-qemu-action@v1
    19  
    20        - name: Setup Docker Buildx
    21          uses: docker/setup-buildx-action@v1
    22  
    23        - name: Login to Docker Hub
    24          uses: docker/login-action@v1
    25          with:
    26            username: ${{ secrets.DOCKER_USERNAME }}
    27            password: ${{ secrets.DOCKER_PASSWORD }}
    28  
    29        - name: Prepare
    30          id: prepare
    31          run: |
    32            echo ::set-output name=docker_platforms::linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64
    33            echo ::set-output name=docker_image::${{ secrets.DOCKER_USERNAME }}/trojan-go
    34            echo ::set-output name=ref::${{ github.sha }}
    35  
    36        - name: Build and push docker image
    37          run: |
    38            docker buildx build --platform ${{ steps.prepare.outputs.docker_platforms }} \
    39            --output "type=image,push=true" \
    40            --tag "${{ steps.prepare.outputs.docker_image }}:nightly" \
    41            --build-arg REF=${{ steps.prepare.outputs.ref }} \
    42            --file Dockerfile .
    43  
    44    test:
    45      needs: build
    46      runs-on: ubuntu-latest
    47      steps:
    48        - name: Test docker image
    49          run: |
    50            docker run --rm --entrypoint /usr/local/bin/trojan-go ${{ secrets.DOCKER_USERNAME }}/trojan-go -version