mirror of
https://github.com/LizardByte/Sunshine.git
synced 2025-04-17 11:43:04 +00:00
docker build dependent on event type (#812)
This commit is contained in:
parent
4b642f6e01
commit
3f202be09a
19
.github/workflows/ci-docker.yml
vendored
19
.github/workflows/ci-docker.yml
vendored
@ -11,6 +11,9 @@
|
|||||||
# `# platforms: `
|
# `# platforms: `
|
||||||
# Comma separated list of platforms, i.e. `# platforms: linux/386,linux/amd64`. Docker platforms can alternatively
|
# Comma separated list of platforms, i.e. `# platforms: linux/386,linux/amd64`. Docker platforms can alternatively
|
||||||
# be listed in a file named `.docker_platforms`.
|
# be listed in a file named `.docker_platforms`.
|
||||||
|
# `# platforms_pr: `
|
||||||
|
# Comma separated list of platforms to run for PR events, i.e. `# platforms_pr: linux/amd64`. This will take
|
||||||
|
# precedence over the `# platforms: ` directive.
|
||||||
# `# artifacts: `
|
# `# artifacts: `
|
||||||
# `true` to build in two steps, stopping at `artifacts` build stage and extracting the image from there to the
|
# `true` to build in two steps, stopping at `artifacts` build stage and extracting the image from there to the
|
||||||
# GitHub runner.
|
# GitHub runner.
|
||||||
@ -202,8 +205,7 @@ jobs:
|
|||||||
# get branch name
|
# get branch name
|
||||||
BRANCH=${GITHUB_HEAD_REF}
|
BRANCH=${GITHUB_HEAD_REF}
|
||||||
|
|
||||||
if [ -z "$BRANCH" ]
|
if [ -z "$BRANCH" ]; then
|
||||||
then
|
|
||||||
echo "This is a PUSH event"
|
echo "This is a PUSH event"
|
||||||
BRANCH=${{ github.ref_name }}
|
BRANCH=${{ github.ref_name }}
|
||||||
fi
|
fi
|
||||||
@ -237,6 +239,19 @@ jobs:
|
|||||||
|
|
||||||
# parse custom directives out of dockerfile
|
# parse custom directives out of dockerfile
|
||||||
# try to get the platforms from the dockerfile custom directive, i.e. `# platforms: xxx,yyy`
|
# try to get the platforms from the dockerfile custom directive, i.e. `# platforms: xxx,yyy`
|
||||||
|
# directives for PR event, i.e. not push event
|
||||||
|
if [[ ${PUSH} == "false" ]]; then
|
||||||
|
while read -r line; do
|
||||||
|
if [[ $line == "# platforms_pr: "* && $PLATFORMS == "" ]]; then
|
||||||
|
# echo the line and use `sed` to remove the custom directive
|
||||||
|
PLATFORMS=$(echo -e "$line" | sed 's/# platforms_pr: //')
|
||||||
|
elif [[ $PLATFORMS != "" ]]; then
|
||||||
|
# break while loop once all custom "PR" event directives are found
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done <"${{ matrix.dockerfile }}"
|
||||||
|
fi
|
||||||
|
# directives for all events... above directives will not be parsed if they were already found
|
||||||
while read -r line; do
|
while read -r line; do
|
||||||
if [[ $line == "# platforms: "* && $PLATFORMS == "" ]]; then
|
if [[ $line == "# platforms: "* && $PLATFORMS == "" ]]; then
|
||||||
# echo the line and use `sed` to remove the custom directive
|
# echo the line and use `sed` to remove the custom directive
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
|
# syntax=docker/dockerfile:1.4
|
||||||
# artifacts: true
|
# artifacts: true
|
||||||
# platforms: linux/amd64,linux/arm64/v8
|
# platforms: linux/amd64,linux/arm64/v8
|
||||||
|
# platforms_pr: linux/amd64
|
||||||
ARG BASE=debian
|
ARG BASE=debian
|
||||||
ARG TAG=bullseye
|
ARG TAG=bullseye
|
||||||
FROM ${BASE}:${TAG} AS sunshine-base
|
FROM ${BASE}:${TAG} AS sunshine-base
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
|
# syntax=docker/dockerfile:1.4
|
||||||
# artifacts: true
|
# artifacts: true
|
||||||
# platforms: linux/amd64,linux/arm64/v8
|
# platforms: linux/amd64,linux/arm64/v8
|
||||||
|
# platforms_pr: linux/amd64
|
||||||
ARG BASE=fedora
|
ARG BASE=fedora
|
||||||
ARG TAG=36
|
ARG TAG=36
|
||||||
FROM ${BASE}:${TAG} AS sunshine-base
|
FROM ${BASE}:${TAG} AS sunshine-base
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
|
# syntax=docker/dockerfile:1.4
|
||||||
# artifacts: true
|
# artifacts: true
|
||||||
# platforms: linux/amd64,linux/arm64/v8
|
# platforms: linux/amd64,linux/arm64/v8
|
||||||
|
# platforms_pr: linux/amd64
|
||||||
ARG BASE=fedora
|
ARG BASE=fedora
|
||||||
ARG TAG=37
|
ARG TAG=37
|
||||||
FROM ${BASE}:${TAG} AS sunshine-base
|
FROM ${BASE}:${TAG} AS sunshine-base
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
|
# syntax=docker/dockerfile:1.4
|
||||||
# artifacts: true
|
# artifacts: true
|
||||||
# platforms: linux/amd64,linux/arm64/v8
|
# platforms: linux/amd64,linux/arm64/v8
|
||||||
|
# platforms_pr: linux/amd64
|
||||||
ARG BASE=ubuntu
|
ARG BASE=ubuntu
|
||||||
ARG TAG=18.04
|
ARG TAG=18.04
|
||||||
FROM ${BASE}:${TAG} AS sunshine-base
|
FROM ${BASE}:${TAG} AS sunshine-base
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
|
# syntax=docker/dockerfile:1.4
|
||||||
# artifacts: true
|
# artifacts: true
|
||||||
# platforms: linux/amd64,linux/arm64/v8
|
# platforms: linux/amd64,linux/arm64/v8
|
||||||
|
# platforms_pr: linux/amd64
|
||||||
ARG BASE=ubuntu
|
ARG BASE=ubuntu
|
||||||
ARG TAG=20.04
|
ARG TAG=20.04
|
||||||
FROM ${BASE}:${TAG} AS sunshine-base
|
FROM ${BASE}:${TAG} AS sunshine-base
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
|
# syntax=docker/dockerfile:1.4
|
||||||
# artifacts: true
|
# artifacts: true
|
||||||
# platforms: linux/amd64,linux/arm64/v8
|
# platforms: linux/amd64,linux/arm64/v8
|
||||||
|
# platforms_pr: linux/amd64
|
||||||
ARG BASE=ubuntu
|
ARG BASE=ubuntu
|
||||||
ARG TAG=22.04
|
ARG TAG=22.04
|
||||||
FROM ${BASE}:${TAG} AS sunshine-base
|
FROM ${BASE}:${TAG} AS sunshine-base
|
||||||
|
Loading…
x
Reference in New Issue
Block a user