chore(deps): bump body-parser and express in /server #247
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: DockerBuild | |
on: | |
push: | |
branches: | |
- 'master' | |
pull_request: | |
branches: | |
- 'master' | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
prepare_ci_run: | |
name: Prepare Docker Build | |
runs-on: ubuntu-latest | |
outputs: | |
GIT_SHA: ${{ steps.extract_branch.outputs.GIT_SHA }} | |
BRANCH: ${{ steps.extract_branch.outputs.BRANCH }} | |
BRANCH_SLUG: ${{ steps.extract_branch.outputs.BRANCH_SLUG }} | |
VERSION: ${{ steps.get_version.outputs.VERSION }} | |
DATE: ${{ steps.get_datetime.outputs.DATE }} | |
TIME: ${{ steps.get_datetime.outputs.TIME }} | |
DATETIME: ${{ steps.get_datetime.outputs.DATETIME }} | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v2.4.0 | |
with: | |
fetch-depth: 0 # need to checkout "all commits" for certain features to work (e.g., get all changed files) | |
submodules: 'true' | |
- name: Extract branch name | |
id: extract_branch | |
# see https://github.com/keptn/gh-action-extract-branch-name for details | |
uses: keptn/gh-action-extract-branch-name@main | |
- name: 'Get Previous tag' | |
id: get_previous_tag | |
uses: "WyriHaximus/github-action-get-previous-tag@v1.1" | |
- name: 'Get next patch version' | |
id: get_next_semver_tag | |
uses: "WyriHaximus/github-action-next-semvers@v1.1" | |
with: | |
version: ${{ steps.get_previous_tag.outputs.tag }} | |
- name: Get the version | |
id: get_version | |
env: | |
BRANCH: ${{ steps.extract_branch.outputs.BRANCH }} | |
BRANCH_SLUG: ${{ steps.extract_branch.outputs.BRANCH_SLUG }} | |
shell: bash | |
run: | | |
# determine version | |
GIT_LAST_TAG=${{ steps.get_previous_tag.outputs.tag }} | |
GIT_NEXT_TAG=${{ steps.get_next_semver_tag.outputs.patch }} | |
echo "GIT_LAST_TAG=${GIT_LAST_TAG}, GIT_NEXT_TAG=${GIT_NEXT_TAG}" | |
if [[ "$BRANCH" == "master" ]]; then | |
# master branch = latest | |
VERSION="${GIT_NEXT_TAG}-dev" | |
else | |
# Feature/Development Branch - use last tag with branch slug | |
VERSION="${GIT_NEXT_TAG}-dev-${BRANCH_SLUG}" | |
fi | |
echo "VERSION=${VERSION}" | |
echo "::set-output name=VERSION::${VERSION}" | |
- name: Get current date and time | |
id: get_datetime | |
run: | | |
echo "::set-output name=DATE::$(date +'%Y%m%d')" | |
echo "::set-output name=TIME::$(date +'%H%M')" | |
echo "::set-output name=DATETIME::$(date +'%Y%m%d')$(date +'%H%M')" | |
docker_build: | |
name: Docker Build | |
needs: [ prepare_ci_run ] | |
runs-on: ubuntu-latest | |
env: | |
BRANCH: ${{ needs.prepare_ci_run.outputs.BRANCH }} | |
VERSION: ${{ needs.prepare_ci_run.outputs.VERSION }} | |
DATETIME: ${{ needs.prepare_ci_run.outputs.DATE }}${{ needs.prepare_ci_run.outputs.TIME }} | |
GIT_SHA: ${{ needs.prepare_ci_run.outputs.GIT_SHA }} | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v2.4.0 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v1 | |
if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event.pull_request.head.repo.full_name == github.repository) | |
with: | |
username: ${{ secrets.REGISTRY_USER }} | |
password: ${{ secrets.REGISTRY_PASSWORD }} | |
- id: docker_build_image | |
name: "Docker Build striessnigk/willneverbefinishedbot" | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
tags: | | |
striessnigk/willneverbefinishedbot:latest-dev | |
striessnigk/willneverbefinishedbot:${{ env.VERSION }} | |
build-args: | | |
version=${{ env.VERSION }} | |
logLevel=info | |
push: true | |
pull: true |