PTU5KAS/.github/workflows/release.yml
Jan Kiszka 0f779e6577 Switch to github workflow
Add the github/ghcr equivalent to travis/dockerhub. With this in place,
we can also deploy the next and latest images to ghcr. Adjust
Dockerfile.isar accordingly. Also update the badge shown in the README.

We model the workflow with github a bit differently than so far: next
and master branch are different workflows. The former includes testing,
the latter just updates the container image. This is based on the
(offline) workflow to push changes to next first and have no commits
in master that haven't been in next before, except for release commits.

The master workflow also triggers on tags in which case it additionally
tags the container images accordingly and pushed that as well.

Travis is removed in the same run to avoid pushing differently built
images to the different registries.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2020-09-24 13:13:12 +02:00

46 lines
1.5 KiB
YAML

name: release
on:
push:
tags:
- '*.*'
jobs:
deploy_containers:
name: Build and deploy container images
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@v2
- name: Get release
run: echo ::set-env name=RELEASE_VERSION::${GITHUB_REF#refs/tags/}
- name: Login to ghcr.io
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ secrets.PACKAGE_DEPLOY_USER }}
password: ${{ secrets.PACKAGE_DEPLOY_TOKEN }}
- name: Build kas image
uses: docker/build-push-action@v2
with:
tags: |
ghcr.io/siemens/kas/kas
ghcr.io/siemens/kas/kas:${{ env.RELEASE_VERSION }}
ghcr.io/siemens/kas/kas:latest-release
- name: Build kas-isar image
uses: docker/build-push-action@v2
with:
file: Dockerfile.isar
tags: |
ghcr.io/siemens/kas/kas-isar
ghcr.io/siemens/kas/kas-isar:${{ env.RELEASE_VERSION }}
ghcr.io/siemens/kas/kas-isar:latest-release
- name: Push images
run: |
docker push ghcr.io/siemens/kas/kas
docker push ghcr.io/siemens/kas/kas:${{ env.RELEASE_VERSION }}
docker push ghcr.io/siemens/kas/kas:latest-release
docker push ghcr.io/siemens/kas/kas-isar
docker push ghcr.io/siemens/kas/kas-isar:${{ env.RELEASE_VERSION }}
docker push ghcr.io/siemens/kas/kas-isar:latest-release