Skip to content

Publish Docker image on Release #10

Publish Docker image on Release

Publish Docker image on Release #10

Workflow file for this run

name: Publish Docker image on Release
on:
workflow_dispatch:
branches: [ master ]
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Get the tag version for building image
id: get_version
run: echo ::set-env name=VERSION::$)git tag --sort=taggerdate -l [0-9]* | tail -n1)
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
- name: Get current date for building image
id: get_date
run: echo "::set-output name=BUILD_TIME::$(date -u '+%Y-%m-%d_%H:%M:%S')"
- name: Get commit hash for building image
id: get_commit
run: echo "::set-output name=COMMIT::$(git rev-parse --short HEAD)"
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@master
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
PROJECT: 'github.com/nokia/adcs-sim/adcs-sim'
with:
name: djkormo/adcs-issuer
buildargs: PROJECT,COMMIT,BUILD_TIME,VERSION
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
tags: "latest,${{ env.VERSION }}"