Skip to content

Commit

Permalink
ci(docker): build image on release (#11828)
Browse files Browse the repository at this point in the history
* feat(docker): build image on release

* separate trigger separate handling

* fix triggers

* less states for docker build on PR's
  • Loading branch information
dpgaspar committed Nov 27, 2020
1 parent 3578410 commit f121107
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/workflows/docker.yml
@@ -1,6 +1,13 @@
name: Docker

on: [push, pull_request]
on:
push:
branches:
- 'master'
pull_request:
types: [opened, synchronize, reopened]
release:
types: [published]

jobs:
build:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/docker_build_push.sh
Expand Up @@ -24,6 +24,9 @@ if [[ "${GITHUB_EVENT_NAME}" == "pull_request" ]]; then
REFSPEC="${GITHUB_HEAD_REF/[^a-zA-Z0-9]/-}"
PR_NUM=$(echo "${GITHUB_REF}" | sed 's:refs/pull/::' | sed 's:/merge::')
LATEST_TAG="pr-${PR_NUM}"
elif [[ "${GITHUB_EVENT_NAME}" == "release" ]]; then
REFSPEC="${GITHUB_REF}"
LATEST_TAG="${REFSPEC}"
else
REFSPEC=$(echo "${GITHUB_REF}" | sed 's:refs/heads/::' | sed 's/[^a-zA-Z0-9]/-/')
LATEST_TAG="${REFSPEC}"
Expand Down

0 comments on commit f121107

Please sign in to comment.