Skip to content

Commit

Permalink
adding parameters for dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
djkormo committed Mar 9, 2024
1 parent 7641345 commit c2ca7ea
Showing 1 changed file with 40 additions and 28 deletions.
68 changes: 40 additions & 28 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,40 @@
name: Publish Docker image on Release

on:
release:
types: [published]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master

- name: Get the version from tag
id: get_version
run: echo ::set-env name=VERSION::${GITHUB_REF#refs/tags/}
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'

- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@master
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
with:
name: djkormo/adcs-issuer
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
buildargs: VERSION
tags: "latest,${{ env.VERSION }}"
name: Publish Docker image on Release

on:
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::${GITHUB_REF#refs/tags/}

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'

run: echo VERSION $VERSION - PROJECT $PROJECT - COMMIT $COMMIT - BUILD_TIME $BUILD_TIME
with:
name: djkormo/adcs-issuer
buildargs: PROJECT,COMMIT,BUILD_TIME,VERSION
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
tags: "latest,${{ env.VERSION }}"

0 comments on commit c2ca7ea

Please sign in to comment.