Skip to content

Merge pull request #22 from tynany/update_go_1_22 #5

Merge pull request #22 from tynany/update_go_1_22

Merge pull request #22 from tynany/update_go_1_22 #5

Workflow file for this run

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 }}