forked from lazedo/freeswitch-docker-alpine
-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (62 loc) · 2.8 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Build FreeSwitch docker images
on:
push:
branches:
- 'main'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: true
- run: |
pkgver=$(grep -E -o pkgver=.* ./aports/main/freeswitch/APKBUILD | grep -E -o [0-9]+\.[0-9]+\.[0-9]+)
echo "alpineVersion=$(git -C ./aports describe --abbrev=0 --tag --match v[0-9].* | grep -o -E [0-9]\.[0-9]+\.[0-9]+)" >> $GITHUB_ENV
echo "pkgrel=$(grep -E -o pkgrel=.* ./aports/main/freeswitch/APKBUILD | grep -E -o [0-9]+)" >> $GITHUB_ENV
echo "pkgverMajor=$(echo $pkgver | grep -E -o [0-9]+ | head -n1 | tail -n1)" >> $GITHUB_ENV
echo "pkgverMinor=$(echo $pkgver | grep -E -o [0-9]+ | head -n2 | tail -n1)" >> $GITHUB_ENV
echo "pkgverBuild=$(echo $pkgver | grep -E -o [0-9]+ | head -n3 | tail -n1)" >> $GITHUB_ENV
echo "versionHeight=$(git rev-list --count HEAD)" >> $GITHUB_ENV
- name: Set versions
run: |
echo "version1=${{ env.pkgverMajor }}" >> $GITHUB_ENV
echo "version2=${{ env.pkgverMajor }}.${{ env.pkgverMinor }}" >> $GITHUB_ENV
echo "version3=${{ env.pkgverMajor }}.${{ env.pkgverMinor }}.${{ env.pkgverBuild }}" >> $GITHUB_ENV
echo "version4=${{ env.pkgverMajor }}.${{ env.pkgverMinor }}.${{ env.pkgverBuild }}-r${{ env.pkgrel }}" >> $GITHUB_ENV
echo "version5=${{ env.pkgverMajor }}.${{ env.pkgverMinor }}.${{ env.pkgverBuild }}-r${{ env.pkgrel }}.${{env.versionHeight}}" >> $GITHUB_ENV
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.PACKAGES_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build Dockerfile
uses: docker/build-push-action@v4
with:
push: true
file: Dockerfile
platforms: |
linux/amd64
# linux/aarch64
build-args: |
version=${{ env.version4 }}
versionHeight=${{ env.versionHeight }}
alpineVersion=${{ env.alpineVersion }}
tags: |
ghcr.io/exram/freeswitch:${{ env.version1 }}
ghcr.io/exram/freeswitch:${{ env.version2 }}
ghcr.io/exram/freeswitch:${{ env.version3 }}
ghcr.io/exram/freeswitch:${{ env.version4 }}
ghcr.io/exram/freeswitch:${{ env.version5 }}
- name: Bump version and push tag
uses: mathieudutour/github-tag-action@v6.1
with:
custom_tag: ${{ env.version5 }}
github_token: ${{ secrets.GITHUB_TOKEN }}