Skip to content

github: add docker push readme action #29

github: add docker push readme action

github: add docker push readme action #29

Workflow file for this run

name: Push OpenSIPS Control Panel Image in Docker Hub
on:
push:
repository_dispatch:
types: [OpenSIPS CP trigger]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Log in to Docker Hub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Determine tag
run: |
if [ "${{ github.event_name }}" == "repository_dispatch" ]; then
echo "BRANCH=${{ github.event.client_payload.branch && github.event.client_payload.branch || 'master' }}" >> $GITHUB_ENV
echo "DOCKER_TAG=${{ github.event.client_payload.docker_tag }}" >> $GITHUB_ENV
else
echo "DOCKER_TAG=latest" >> $GITHUB_ENV
echo "BRANCH=master" >> $GITHUB_ENV
fi
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
build-args: |
OPENSIPS_CP_VERSION=${{ env.BRANCH }}
push: true
tags: opensips/opensips-cp:${{ env.DOCKER_TAG }}