Skip to content

Merge pull request #220 from D10S0VSkY-OSS/hotfix/binary_download #222

Merge pull request #220 from D10S0VSkY-OSS/hotfix/binary_download

Merge pull request #220 from D10S0VSkY-OSS/hotfix/binary_download #222

name: SLD Dashboard Docker Image CI
on:
push:
branches: [ master ]
release:
types: [created]
workflow_dispatch:
jobs:
build-and-push:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
# Login to Docker Hub
- name: Docker login
env:
DOCKER_USER: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
# Build and push the Docker image with new tag for releases
- name: Build and push Docker image with new tag
if: github.event_name == 'release'
working-directory: ./sld-dashboard
run: |
TAG=$(echo $GITHUB_REF | sed 's/refs\/tags\///')
docker build . --file Dockerfile --tag ${{ secrets.DOCKER_USERNAME }}/sld-dashboard:$TAG
docker push ${{ secrets.DOCKER_USERNAME }}/sld-dashboard:$TAG
# Build and push the Docker image with 'latest' tag for master branch
- name: Build and push Docker image with latest tag
if: github.ref == 'refs/heads/master'
working-directory: ./sld-dashboard
run: |
docker build . --file Dockerfile --tag ${{ secrets.DOCKER_USERNAME }}/sld-dashboard:latest
docker push ${{ secrets.DOCKER_USERNAME }}/sld-dashboard:latest