mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-16 02:02:58 -07:00
Update docker build workflow
This commit is contained in:
parent
ab75628cf7
commit
401b75a76b
1 changed files with 27 additions and 34 deletions
61
.github/workflows/publish-docker.yml
vendored
61
.github/workflows/publish-docker.yml
vendored
|
@ -27,17 +27,21 @@ jobs:
|
||||||
fi
|
fi
|
||||||
echo ::set-output name=commit::${GITHUB_SHA}
|
echo ::set-output name=commit::${GITHUB_SHA}
|
||||||
echo ::set-output name=build_date::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
|
echo ::set-output name=build_date::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
|
||||||
echo ::set-output name=docker_platforms::linux/amd64,linux/arm64,linux/arm
|
echo ::set-output name=docker_platforms::linux/amd64,linux/arm64/v8,linux/arm/v7,linux/arm/v6
|
||||||
echo ::set-output name=docker_image::${{ secrets.DOCKER_REPO }}/tautulli
|
echo ::set-output name=docker_image::${{ secrets.DOCKER_REPO }}/tautulli
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v1
|
||||||
|
with:
|
||||||
|
platforms: all
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
id: buildx
|
id: buildx
|
||||||
uses: crazy-max/ghaction-docker-buildx@v3
|
uses: docker/setup-buildx-action@v1
|
||||||
with:
|
with:
|
||||||
buildx-version: latest
|
version: latest
|
||||||
|
|
||||||
- name: Cache Docker Layers
|
- name: Cache Docker Layers
|
||||||
id: cache
|
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
path: /tmp/.buildx-cache
|
path: /tmp/.buildx-cache
|
||||||
|
@ -45,40 +49,29 @@ jobs:
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-buildx-
|
${{ runner.os }}-buildx-
|
||||||
|
|
||||||
- name: Docker Buildx (no push)
|
|
||||||
run: |
|
|
||||||
docker buildx build \
|
|
||||||
--cache-from "type=local,src=/tmp/.buildx-cache" \
|
|
||||||
--cache-to "type=local,dest=/tmp/.buildx-cache" \
|
|
||||||
--platform ${{ steps.prepare.outputs.docker_platforms }} \
|
|
||||||
--output "type=image,push=false" \
|
|
||||||
--build-arg "TAG=${{ steps.prepare.outputs.tag }}" \
|
|
||||||
--build-arg "BRANCH=${{ steps.prepare.outputs.branch }}" \
|
|
||||||
--build-arg "COMMIT=${{ steps.prepare.outputs.commit }}" \
|
|
||||||
--build-arg "BUILD_DATE=${{ steps.prepare.outputs.build_date }}" \
|
|
||||||
--tag "${{ steps.prepare.outputs.docker_image }}:${{ steps.prepare.outputs.tag }}" \
|
|
||||||
--file Dockerfile .
|
|
||||||
|
|
||||||
- name: Docker Login
|
- name: Docker Login
|
||||||
|
uses: docker/login-action@v1
|
||||||
if: success()
|
if: success()
|
||||||
env:
|
with:
|
||||||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
run: |
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
echo "${DOCKER_PASSWORD}" | docker login --username "${{ secrets.DOCKER_USERNAME }}" --password-stdin
|
|
||||||
|
|
||||||
- name: Docker Buildx (push)
|
- name: Docker Build and Push
|
||||||
|
uses: docker/build-push-action@v2
|
||||||
if: success()
|
if: success()
|
||||||
run: |
|
with:
|
||||||
docker buildx build \
|
context: .
|
||||||
--cache-from "type=local,src=/tmp/.buildx-cache" \
|
file: ./Dockerfile
|
||||||
--platform ${{ steps.prepare.outputs.docker_platforms }} \
|
push: true
|
||||||
--output "type=image,push=true" \
|
platforms: ${{ steps.prepare.outputs.docker_platforms }}
|
||||||
--build-arg "TAG=${{ steps.prepare.outputs.tag }}" \
|
build-args: |
|
||||||
--build-arg "BRANCH=${{ steps.prepare.outputs.branch }}" \
|
TAG=${{ steps.prepare.outputs.tag }},
|
||||||
--build-arg "COMMIT=${{ steps.prepare.outputs.commit }}" \
|
BRANCH=${{ steps.prepare.outputs.branch }},
|
||||||
--build-arg "BUILD_DATE=${{ steps.prepare.outputs.build_date }}" \
|
COMMIT=${{ steps.prepare.outputs.commit }},
|
||||||
--tag "${{ steps.prepare.outputs.docker_image }}:${{ steps.prepare.outputs.tag }}" \
|
BUILD_DATE=${{ steps.prepare.outputs.build_date }}
|
||||||
--file Dockerfile .
|
tags: ${{ steps.prepare.outputs.docker_image }}:${{ steps.prepare.outputs.tag }}
|
||||||
|
cache-from: type=local,src=/tmp/.buildx-cache
|
||||||
|
cache-to: type=local,dest=/tmp/.buildx-cache
|
||||||
|
|
||||||
- name: Clear
|
- name: Clear
|
||||||
if: always()
|
if: always()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue