Skip to content

Update Dockerfile ROS 7.15.3 #76

Update Dockerfile ROS 7.15.3

Update Dockerfile ROS 7.15.3 #76

name: Docker
on:
push:
paths:
# temporary disabled
- '*Dockerfile'
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
# https://github.com/actions/checkout/issues/701
fetch-depth: 0
- run: echo "GIT_TAG=`echo v$(sed -nE 's/^.*ROUTEROS_VERSION="([0-9]+\.[0-9]+).*?"/\1/p' Dockerfile)`" >> $GITHUB_ENV
- name: Log into registry #1
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USER1 }}
password: ${{ secrets.DOCKERHUB_TOKEN1 }}
- name: Build and push Docker image to the repo #1
uses: docker/build-push-action@v6
with:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ secrets.DOCKERHUB_USER1 }}/routeros:latest,${{ secrets.DOCKERHUB_USER1 }}/routeros:${{ env.GIT_TAG }}
- name: Log into registry #2
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USER2 }}
password: ${{ secrets.DOCKERHUB_TOKEN2 }}
- name: Build and push Docker image to the repo #2
uses: docker/build-push-action@v6
with:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ secrets.DOCKERHUB_USER2 }}/routeros:latest,${{ secrets.DOCKERHUB_USER2 }}/routeros:${{ env.GIT_TAG }}