2021-07-23 12:42:50 +00:00
|
|
|
name: Publish Docker image
|
|
|
|
on:
|
|
|
|
release:
|
|
|
|
types: [published]
|
|
|
|
jobs:
|
|
|
|
docker_publish:
|
|
|
|
name: Push Docker image to Github Hub
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Get the version
|
|
|
|
id: vars
|
|
|
|
run: |
|
|
|
|
echo ::set-output name=sha::$(echo ${GITHUB_SHA:0:7})
|
|
|
|
echo ::set-output name=tag::$(echo ${GITHUB_REF#refs/tags/})
|
|
|
|
- name: Docker Login to Registry
|
2022-09-09 11:43:01 +00:00
|
|
|
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u cerc-io --password-stdin
|
2021-07-23 12:42:50 +00:00
|
|
|
- name: Docker Pull
|
2022-09-09 11:43:01 +00:00
|
|
|
run: docker pull ghcr.io/cerc-io/watcher-ts:${{steps.vars.outputs.sha}}
|
2021-07-23 12:42:50 +00:00
|
|
|
- name: Tag docker image
|
2022-09-09 11:43:01 +00:00
|
|
|
run: docker tag ghcr.io/cerc-io/watcher-ts:${{steps.vars.outputs.sha}} ghcr.io/cerc-io/watcher-ts:${{steps.vars.outputs.tag}}
|
2021-07-23 12:42:50 +00:00
|
|
|
- name: Docker Push to Github Hub
|
2022-09-09 11:43:01 +00:00
|
|
|
run: docker push ghcr.io/cerc-io/watcher-ts:${{steps.vars.outputs.tag}}
|