Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.github/workflows: added GitHub action script to build Alpine docker #3420

Closed
wants to merge 30 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
72 changes: 54 additions & 18 deletions .github/workflows/alpine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,14 @@ name: alpine docker image
on:
push:
branches:
- master
- master
tags:
- '5.6.*'
- '5.5.*'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
permissions:
contents: read # to fetch code (actions/checkout)
- '5.6.*'
- '5.7.*'

# This environments for backward compatability with build script for DockerHub
env:
IMAGE_NAME: kamailio-ci
DOCKER_REPO: kamailio/kamailio-ci
SOURCE_BRANCH: ${{ github.ref_name }}

Expand All @@ -22,26 +19,65 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Login to GitHub Container Registry
if: ${{ env.GITHUB_BASE_REF == '' }}
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Compile Kamailio source
run: |
git submodule init
git submodule update
cd `pwd`/pkg/docker/alpine
./hooks/pre_build || true

- name: Build the Docker images
run: |
cd `pwd`/pkg/docker/alpine
sudo chown -R ${USER}:${USER} `pwd`
./hooks/build
- name: Login to Docker Hub
if: ${{ env.GITHUB_BASE_REF == '' }}
uses: docker/login-action@v2

- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Push images to DockerHub
if: ${{ env.GITHUB_BASE_REF == '' }}
run: |
cd `pwd`/pkg/docker/alpine
./hooks/push
./hooks/post_push
# list of Docker images to use as base name for tags
images: |
ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}
# generate Docker tags based on the following events/attributes
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=ref,event=branch

- name: Build and push minimal
uses: docker/build-push-action@v4
with:
context: pkg/docker/alpine
file: Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Build and push with apk
uses: docker/build-push-action@v4
with:
context: pkg/docker/alpine
file: Dockerfile.alpine
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Build and push with debug
uses: docker/build-push-action@v4
with:
context: pkg/docker/alpine
file: Dockerfile.debug
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
26 changes: 0 additions & 26 deletions .github/workflows/cifuzz.yml

This file was deleted.

62 changes: 0 additions & 62 deletions .github/workflows/codeql.yml

This file was deleted.

41 changes: 0 additions & 41 deletions .github/workflows/main.yml

This file was deleted.

35 changes: 0 additions & 35 deletions .github/workflows/pull_request.yml

This file was deleted.