mirror of
https://github.com/librenms/docker.git
synced 2026-01-23 18:25:09 +00:00
Use crazy-max/ghaction-docker-login action
This commit is contained in:
parent
f21bdf7ef8
commit
6e1ecbb561
1 changed files with 5 additions and 12 deletions
17
.github/workflows/build.yml
vendored
17
.github/workflows/build.yml
vendored
|
|
@ -25,7 +25,6 @@ jobs:
|
|||
name: Prepare
|
||||
id: prepare
|
||||
run: |
|
||||
DOCKER_USERNAME=librenmsbot
|
||||
DOCKER_IMAGE=librenms/librenms
|
||||
DOCKER_PLATFORMS=linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/386,linux/ppc64le
|
||||
VERSION=edge
|
||||
|
|
@ -40,7 +39,6 @@ jobs:
|
|||
TAGS="$TAGS --tag ${DOCKER_IMAGE}:latest"
|
||||
fi
|
||||
|
||||
echo ::set-output name=docker_username::${DOCKER_USERNAME}
|
||||
echo ::set-output name=docker_image::${DOCKER_IMAGE}
|
||||
echo ::set-output name=version::${VERSION}
|
||||
echo ::set-output name=buildx_args::--platform ${DOCKER_PLATFORMS} \
|
||||
|
|
@ -55,12 +53,12 @@ jobs:
|
|||
name: Docker Buildx (build)
|
||||
run: |
|
||||
docker buildx build --output "type=image,push=false" ${{ steps.prepare.outputs.buildx_args }}
|
||||
- name: Docker Login
|
||||
- name: Login to DockerHub
|
||||
if: success() && github.event_name != 'pull_request' && (endsWith(github.ref, github.event.repository.default_branch) || startsWith(github.ref, 'refs/tags/'))
|
||||
env:
|
||||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
||||
run: |
|
||||
echo "${DOCKER_PASSWORD}" | docker login --username "${{ steps.prepare.outputs.docker_username }}" --password-stdin
|
||||
uses: crazy-max/ghaction-docker-login@v1.1.0
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
-
|
||||
name: Docker Buildx (push)
|
||||
if: success() && github.event_name != 'pull_request' && (endsWith(github.ref, github.event.repository.default_branch) || startsWith(github.ref, 'refs/tags/'))
|
||||
|
|
@ -71,8 +69,3 @@ jobs:
|
|||
if: success() && github.event_name != 'pull_request' && (endsWith(github.ref, github.event.repository.default_branch) || startsWith(github.ref, 'refs/tags/'))
|
||||
run: |
|
||||
docker run --rm mplatform/mquery ${{ steps.prepare.outputs.docker_image }}:${{ steps.prepare.outputs.version }}
|
||||
-
|
||||
name: Clear
|
||||
if: always() && github.event_name != 'pull_request' && (endsWith(github.ref, github.event.repository.default_branch) || startsWith(github.ref, 'refs/tags/'))
|
||||
run: |
|
||||
rm -f ${HOME}/.docker/config.json
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue