106 lines
2.9 KiB
YAML
106 lines
2.9 KiB
YAML
name: Build Docker Image
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
env:
|
|
DOCKER_ARCH: linux/amd64,linux/386,linux/arm64,linux/arm/v7,linux/arm/v6,linux/s390x,linux/ppc64le
|
|
|
|
jobs:
|
|
buildBase:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Setup QEMU to Docker
|
|
uses: docker/setup-qemu-action@v1
|
|
|
|
- name: Setup Buildx
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
- name: Login into registry Github Packages
|
|
uses: docker/login-action@v1
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- uses: actions/checkout@v2.4.0
|
|
with:
|
|
submodules: true
|
|
|
|
- name: Build Base
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
context: .
|
|
push: false
|
|
target: base
|
|
platforms: ${{ env.DOCKER_ARCH }}
|
|
cache-from: type=gha,scope=${{ github.ref }}_ofvp_badvpn_${{ github.repository }}
|
|
cache-to: type=gha,mode=max,scope=${{ github.ref }}_ofvp_badvpn_${{ github.repository }}
|
|
|
|
badvpn:
|
|
runs-on: ubuntu-latest
|
|
needs:
|
|
- buildBase
|
|
steps:
|
|
- name: Setup QEMU to Docker
|
|
uses: docker/setup-qemu-action@v1
|
|
|
|
- name: Setup Buildx
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
- name: Login into registry Github Packages
|
|
uses: docker/login-action@v1
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- uses: actions/checkout@v2.4.0
|
|
with:
|
|
submodules: true
|
|
|
|
- name: udpgw (Badvpn)
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
context: .
|
|
push: true
|
|
target: udpgw
|
|
cache-from: type=gha,scope=${{ github.ref }}_ofvp_badvpn_${{ github.repository }}
|
|
platforms: ${{ env.DOCKER_ARCH }}
|
|
tags: |
|
|
ghcr.io/ofvp-project/badvpn:latest
|
|
ghcr.io/ofvp-project/udpgw:latest
|
|
|
|
tun2socks:
|
|
runs-on: ubuntu-latest
|
|
needs:
|
|
- buildBase
|
|
steps:
|
|
- name: Setup QEMU to Docker
|
|
uses: docker/setup-qemu-action@v1
|
|
|
|
- name: Setup Buildx
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
- name: Login into registry Github Packages
|
|
uses: docker/login-action@v1
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- uses: actions/checkout@v2.4.0
|
|
with:
|
|
submodules: true
|
|
|
|
- name: tun2socks
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
context: .
|
|
push: true
|
|
target: tun2socks
|
|
cache-from: type=gha,scope=${{ github.ref }}_ofvp_badvpn_${{ github.repository }}
|
|
platforms: ${{ env.DOCKER_ARCH }}
|
|
tags: ghcr.io/ofvp-project/tun2socks:latest
|