Merge pull request #24 from tynany/add-support-for-multi-routing-engi… #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: junos_exporter_docker_upload | |
on: | |
push: | |
branches: | |
- master | |
release: | |
types: created | |
jobs: | |
docker: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Check + set version tag | |
run: | |
echo "GIT_TAG=$(git describe --candidates=0 --tags 2> /dev/null || echo | |
latest_non_release)" >> $GITHUB_ENV | |
- name: Build and push image | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: | | |
tynany/junos_exporter:${{ env.GIT_TAG }} | |
# only push latest tag if a release. | |
- name: Build and push image latest tag | |
if: env.GIT_TAG != 'latest_non_release' | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: | | |
tynany/junos_exporter:latest | |
- name: Image digest | |
run: echo ${{ steps.docker_build.outputs.digest }} |