forked from FFmpeg/FFmpeg
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (50 loc) · 1.45 KB
/
main.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
name: main
on:
push:
branches:
- shio/*
tags:
- '*_shio.*'
pull_request:
branches:
- shio/*
env:
DOCKER_BUILDKIT: 1
OCI_REGISTRY: rg.nl-ams.scw.cloud/shio-solutions
OCI_REPO: tales-media/fork/ffmpeg
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/login-action@v3
if: ${{ github.event_name == 'push' }}
with:
registry: ${{ env.OCI_REGISTRY }}
username: nologin
password: ${{ secrets.SCW_SECRET_KEY }}
- name: info
run: |
docker version
docker info
- name: set tag version
if: ${{ github.ref_type == 'tag' }}
run: |
echo "${{ github.ref_name }}" > VERSION
- name: build
run: |
docker build --pull --no-cache \
-f build/Dockerfile \
--build-arg "FFMPEG_VERSION=$(cat VERSION)" \
-t "${OCI_REGISTRY}/${OCI_REPO}:latest" \
-t "${OCI_REGISTRY}/${OCI_REPO}:${{ github.sha }}" \
-t "${OCI_REGISTRY}/${OCI_REPO}:$(cat VERSION)" \
.
- name: push
if: ${{ github.event_name == 'push' }}
run: |
docker push "${OCI_REGISTRY}/${OCI_REPO}:$(cat VERSION)"
- name: push latest
if: ${{ github.event_name == 'push' && github.ref_name == 'shio/master' }}
run: |
docker push "${OCI_REGISTRY}/${OCI_REPO}:latest"