-
Notifications
You must be signed in to change notification settings - Fork 22
41 lines (38 loc) · 1.35 KB
/
image.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
name: image
on:
workflow_dispatch:
schedule: [{cron: '25 9 * * 3'}] # 9:25 on Wednesdays
push:
branches: [master]
paths:
- docker/*
env:
image: ghcr.io/${{ github.repository }}
# https://docs.docker.com/build/ci/github-actions/examples/#registry-cache
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: docker/setup-buildx-action@v2
- uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v3
with:
context: "{{ defaultContext }}:docker"
push: true
cache-from: type=registry,ref=${{ env.image }}:buildcache
cache-to: type=registry,ref=${{ env.image }}:buildcache,mode=max
tags: |
${{ env.image }}:latest
- name: Tag with OBS versions included in our image
run: |
docker pull ${{ env.image }}:latest
set -x
obs_version=$(docker run --rm ${{ env.image }}:latest obs --version | tr -dc '[0-9.]')
websocket_version=$(docker run --rm ${{ env.image }}:latest timeout 2s xvfb-run obs | grep -Po 'websocket.+Version: \K\d+\.\d+\.\d+')
version_tagged="${{ env.image }}:$obs_version-$websocket_version"
docker tag ${{ env.image }}:latest "$version_tagged"
docker push "$version_tagged"