name: docker on: push: branches: - master - dev - travis-multiarch-builds tags: - 'ng-*' # --build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') \ # --build-arg VCS_REF=${GITHUB_SHA::8} \ jobs: # build and push image to docker hub. buildx: runs-on: ubuntu-latest steps: - name: Prepare id: prepare run: | VERSION=edge if [[ $GITHUB_REF == refs/tags/ng-* ]]; then VERSION=${GITHUB_REF#refs/tags/ng-} fi if [[ $GITHUB_REF == refs/heads/* ]]; then VERSION=${GITHUB_REF#refs/heads/} fi echo ::set-output name=version::${VERSION} - name: Checkout uses: actions/checkout@v2 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 - name: Set up QEMU uses: docker/setup-qemu-action@v1 - name: Cache Docker layers uses: pat-s/always-upload-cache@v2 with: path: /tmp/.buildx-cache key: ${{ runner.os }}-buildx-${{ github.sha }} restore-keys: | ${{ runner.os }}-buildx- - name: Login to DockerHub uses: docker/login-action@v1 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - name: Build and push uses: docker/build-push-action@v2 with: context: . file: ./Dockerfile platforms: linux/amd64,linux/arm/v7 push: true tags: jonaswinkler/paperless-ng:${{ steps.prepare.outputs.version }} cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache - name: Inspect image run: | docker buildx imagetools inspect jonaswinkler/paperless-ng:${{ steps.prepare.outputs.version }}