diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index aaccb797..9cd4faa8 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -31,6 +31,7 @@ jobs: push: true build-args: | VERSION=${{ github.ref }} + ARG0=docker tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} platforms: linux/amd64, linux/arm64, linux/ppc64le, linux/s390x, linux/386, linux/arm/v7, linux/arm/v6 \ No newline at end of file diff --git a/.github/workflows/nightly-docker-build.yml b/.github/workflows/nightly-docker-build.yml new file mode 100644 index 00000000..3508691e --- /dev/null +++ b/.github/workflows/nightly-docker-build.yml @@ -0,0 +1,42 @@ +name: PanIndex Nightly Docker Build +on: + push: + branches: [ dev ] + pull_request: + branches: [ dev ] +jobs: + build_docker: + name: Docker + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + persist-credentials: false + ref: dev + - name: Docker meta + id: meta + uses: docker/metadata-action@v3 + with: + images: iicm/pan-index + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: iicm + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Build and push + id: docker_build + uses: docker/build-push-action@v2 + with: + context: . + push: true + build-args: | + VERSION=${{ github.ref }} + ARG0=nightly_docker + tags: iicm/pan-index:dev + labels: ${{ steps.meta.outputs.labels }} + platforms: linux/amd64, linux/arm64, linux/ppc64le, linux/s390x, linux/386, linux/arm/v7, linux/arm/v6 \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 0e0c7dc7..f473fd3e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,13 @@ FROM alpine:edge as builder LABEL stage=go-builder ARG VERSION +ARG ARG0 ENV GITHUB_REF=$VERSION WORKDIR /app/ COPY ./ ./ RUN apk add --no-cache bash git curl go gcc musl-dev; \ curl -s -O 'https://raw.githubusercontent.com/libsgh/PanIndex-build-action/main/build.sh'; \ - bash build.sh docker + bash build.sh ARG0 FROM alpine:edge MAINTAINER libsgh