forked from jrottenberg/ffmpeg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-steps.yml
35 lines (31 loc) · 1.69 KB
/
azure-steps.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
steps:
- bash: |
set -eu
docker build -t ${DOCKER}:${VERSION}-${VARIANT} -t ${DOCKER}:${LONG_VERSION}-${VARIANT} -t ${GHCR}/${VERSION}-${VARIANT} -t ${GHCR}/${LONG_VERSION}-${VARIANT} --build-arg MAKEFLAGS="-j$(($(grep -c ^processor /proc/cpuinfo) + 1))" docker-images/${VERSION}/${VARIANT}
docker run --rm ${DOCKER}:${LONG_VERSION}-${VARIANT} -buildconf
docker images
displayName: Build docker image
- bash: |
set -eu
echo ${DOCKER_PASSWORD} | docker login --username ${DOCKER_LOGIN} --password-stdin
docker push ${DOCKER}:${VERSION}-${VARIANT}
docker push ${DOCKER}:${LONG_VERSION}-${VARIANT}
echo ${GHCR_PAT} | docker login ghcr.io --username USERNAME --password-stdin
docker push ${GHCR}/${VERSION}-${VARIANT}
docker push ${GHCR}/${LONG_VERSION}-${VARIANT}
if [ "${ISPARENT}" == "True" ] && [ "${VARIANT}" != "${PARENT}" ]
then
docker tag "${DOCKER}:${LONG_VERSION}-${VARIANT}" "${DOCKER}:${VERSION}-${PARENT}"
docker tag "${DOCKER}:${LONG_VERSION}-${VARIANT}" "${DOCKER}:${MAJOR_VERSION}-${PARENT}"
docker push "${DOCKER}:${VERSION}-${PARENT}"
docker push "${DOCKER}:${MAJOR_VERSION}-${PARENT}"
docker tag "${DOCKER}:${LONG_VERSION}-${VARIANT}" "${GHCR}:${VERSION}-${PARENT}"
docker tag "${DOCKER}:${LONG_VERSION}-${VARIANT}" "${GHCR}:${MAJOR_VERSION}-${PARENT}"
docker push "${GHCR}:${VERSION}-${PARENT}"
docker push "${GHCR}:${MAJOR_VERSION}-${PARENT}"
fi
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main'))
displayName: Push docker image
env:
DOCKER_PASSWORD: $(docker.password)
GHCR_PAT: $(ghcr.pat)