Skip to content

ci: bump all GitHub Actions to latest major versions #46

ci: bump all GitHub Actions to latest major versions

ci: bump all GitHub Actions to latest major versions #46

name: Push OpenSIPS Python Images to Docker Hub
on:
push:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch'
steps:
- uses: actions/checkout@v6
- name: Log in to Docker Hub
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Log in to GitHub Container Registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get latest tag if manually triggered
id: get_tag
run: |
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
git fetch --tags
LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
echo "tag=$LATEST_TAG" >> $GITHUB_ENV
else
echo "tag=${{ github.ref_name }}" >> $GITHUB_ENV
fi
- name: Build and push Docker image
uses: docker/build-push-action@v7
with:
context: ./docker/
push: true
tags: |
opensips/python-opensips:latest
opensips/python-opensips:${{ env.tag }}
ghcr.io/opensips/python-opensips:latest
ghcr.io/opensips/python-opensips:${{ env.tag }}