diff --git a/.github/workflows/docker-images.yml b/.github/workflows/docker-images.yml new file mode 100644 index 0000000..dd7f04f --- /dev/null +++ b/.github/workflows/docker-images.yml @@ -0,0 +1,77 @@ +name: docker-images + +on: + push: + branches: + - master + - docker-test + +jobs: + multi: + strategy: + fail-fast: false + matrix: + image: + - bandersnatch + - ftpsync + - homebrew-mirror + - nix-channels + - pub-mirror + - rustup-mirror + include: + - image: tunasync-scripts + dockerfile: . + - image: julia-mirror + dockerfile: dockerfiles/julia + - image: rubygems-mirror + dockerfile: dockerfiles/rubygems + + runs-on: ubuntu-latest + steps: + - + name: Determin docker tag + env: + TAG_NAME: ${{ github.ref }} + run: | + if [ "${TAG_NAME##*/}" = "master" ]; then + tag=latest + else + tag=build-test + fi + echo "::set-env name=docker_tag::${tag}" + - + name: Determin dockerfile + env: + DF: ${{ matrix.dockerfile }} + IMG: ${{ matrix.image }} + run: | + if [ -z "${DF}" ]; then + DF="dockerfiles/${IMG}" + fi + echo "::set-env name=docker_file::${DF}" + - + name: Checkout + uses: actions/checkout@v2 + - + name: Set up QEMU + uses: docker/setup-qemu-action@v1 + with: + platforms: arm64 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - + name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Build and push + uses: docker/build-push-action@v2 + with: + context: . + file: ${{ env.docker_file }}/Dockerfile + platforms: linux/amd64,linux/arm64 + push: true + tags: tunathu/${{ matrix.image }}:${{ env.docker_tag }}