Files
remark42/.github/workflows/blank.yml
T
StasandUmputun 582c9d6bce Fix problem with DEBUG variable (#435)
* Fix problem with DEBUG variable

* Add condition for starting ci on pull requests

* Add default value

* Add default value in another place

* Fix error in bash statement

* Replace && on if condition
2019-09-20 15:12:50 -05:00

40 lines
896 B
YAML

name: Github Actions CI
on:
push:
branches:
tags:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Docker version
run: docker version
- name: Debug if needed
run: |
export DEBUG=${DEBUG:-false}
if [[ "$DEBUG" == "true" ]]; then
env
fi
env:
DEBUG: ${{secrets.DEBUG}}
- name: Build image
run: |
export GIT_BRANCH="${GITHUB_REF/refs\/heads\//}"
export GIT_TAG="${GITHUB_REF/refs\/tags\//}"
if [[ "$GIT_TAG" != "$GITHUB_REF" ]]; then
export GIT_BRANCH=$GIT_TAG
fi
docker build \
--build-arg CI="$GITHUB_WORKFLOW" \
--build-arg GIT_BRANCH=$GIT_BRANCH \
--build-arg COVERALLS_TOKEN=$COVERALLS_TOKEN \
.
env:
COVERALLS_TOKEN: ${{secrets.COVERALLS_TOKEN}}