Files
remark42/.github/workflows/ci-build.yml
T

44 lines
1.1 KiB
YAML

name: build
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 GITHUB_REF=$GITHUB_REF \
--build-arg GITHUB_SHA=GITHUB_SHA \
--build-arg GITHUB_EVENT_NAME=GITHUB_EVENT_NAME \
--build-arg GITHUB_EVENT_PATH=GITHUB_EVENT_PATH \
--build-arg COVERALLS_TOKEN=$COVERALLS_TOKEN \
.
env:
COVERALLS_TOKEN: ${{secrets.COVERALLS_TOKEN}}