feat(cd): configure automated semantic releases

This commit is contained in:
Julian Tölle 2020-05-07 02:34:49 +02:00
parent cf3c281eb3
commit 8e796d7e78
3 changed files with 45 additions and 3 deletions

25
.github/workflows/release.yaml vendored Normal file
View file

@ -0,0 +1,25 @@
name: Release
on:
push:
branches:
- master
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 14
- name: Install semantic-release
run: npm install -g semantic-release @semantic-release/git @semantic-release/changelog @semantic-release/exec semantic-release-docker
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: semantic-release

13
.releaserc.yml Normal file
View file

@ -0,0 +1,13 @@
repositoryUrl": "https://github.com/apricote/Listory"
plugins:
- "@semantic-release/commit-analyzer"
- "@semantic-release/release-notes-generator"
- "@semantic-release/changelog"
- - "@semantic-release/npm"
- npmPublish: false
- - "@semantic-relase/exec"
- prepareCmd: "docker build -t apricote/listory --build-arg VERSION=${nextRelease.version} --build-arg GIT_COMMIT=`git rev-parse HEAD` ."
- - semantic-release-docker
- name: apricote/listory
- "@semantic-release/git"
- "@semantic-release/github"

View file

@ -1,10 +1,14 @@
ARG VERSION=unknown
ARG GIT_COMMIT=unknown
##################
## common
##################
FROM node:14-alpine as common
LABEL org.label-schema.schema-version="1.0" \
org.label-schema.name="listory" \
stage="common"
LABEL org.opencontainers.image.title="listory" \
org.opencontainers.image.version=$VERSION \
org.opencontainers.image.revision=$GIT_COMMIT \
de.apricote.stage="common"
WORKDIR /app