Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ci): pass git revision and build date to the docker build action #4093

Merged
merged 1 commit into from
Nov 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/release_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ jobs:
private-key: ${{ secrets.SSH_PRIVATE_KEY_IOTA_CI }}
private-key-name: github-ppk

- name: Get git revision and build date
id: git-info
run: |
echo "GIT_REVISION=$(git describe --always --abbrev=12 --dirty --exclude '*')" >> $GITHUB_ENV
echo "BUILD_DATE=$(date -u +'%Y-%m-%d')" >> $GITHUB_ENV

- name: Build and push Docker image for iota-node
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # pin@v6
with:
Expand All @@ -85,6 +91,9 @@ jobs:
tags: ${{ steps.meta-node.outputs.tags }}
push: true
pull: true
build-args: |
GIT_REVISION=${{ env.GIT_REVISION }}
BUILD_DATE=${{ env.BUILD_DATE }}

build-iota-indexer:
if: github.event_name == 'workflow_dispatch' && github.event.inputs.iota_indexer == 'true' || github.event_name == 'release'
Expand Down Expand Up @@ -134,6 +143,12 @@ jobs:
private-key: ${{ secrets.SSH_PRIVATE_KEY_IOTA_CI }}
private-key-name: github-ppk

- name: Get git revision and build date
id: git-info
run: |
echo "GIT_REVISION=$(git describe --always --abbrev=12 --dirty --exclude '*')" >> $GITHUB_ENV
echo "BUILD_DATE=$(date -u +'%Y-%m-%d')" >> $GITHUB_ENV

- name: Build and push Docker image for iota-indexer
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # pin@v6
with:
Expand All @@ -144,6 +159,9 @@ jobs:
tags: ${{ steps.meta-indexer.outputs.tags }}
push: true
pull: true
build-args: |
GIT_REVISION=${{ env.GIT_REVISION }}
BUILD_DATE=${{ env.BUILD_DATE }}

build-iota-tools:
if: github.event_name == 'workflow_dispatch' && github.event.inputs.iota_tools == 'true' || github.event_name == 'release'
Expand Down Expand Up @@ -193,6 +211,12 @@ jobs:
private-key: ${{ secrets.SSH_PRIVATE_KEY_IOTA_CI }}
private-key-name: github-ppk

- name: Get git revision and build date
id: git-info
run: |
echo "GIT_REVISION=$(git describe --always --abbrev=12 --dirty --exclude '*')" >> $GITHUB_ENV
echo "BUILD_DATE=$(date -u +'%Y-%m-%d')" >> $GITHUB_ENV

- name: Build and push Docker image for iota-tools
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # pin@v6
with:
Expand All @@ -203,6 +227,9 @@ jobs:
tags: ${{ steps.meta-tools.outputs.tags }}
push: true
pull: true
build-args: |
GIT_REVISION=${{ env.GIT_REVISION }}
BUILD_DATE=${{ env.BUILD_DATE }}

build-iota-graphql-rpc:
if: github.event_name == 'workflow_dispatch' && github.event.inputs.iota_graphql_rpc == 'true' || github.event_name == 'release'
Expand Down Expand Up @@ -252,6 +279,12 @@ jobs:
private-key: ${{ secrets.SSH_PRIVATE_KEY_IOTA_CI }}
private-key-name: github-ppk

- name: Get git revision and build date
id: git-info
run: |
echo "GIT_REVISION=$(git describe --always --abbrev=12 --dirty --exclude '*')" >> $GITHUB_ENV
echo "BUILD_DATE=$(date -u +'%Y-%m-%d')" >> $GITHUB_ENV

- name: Build and push Docker image for iota-graphql-rpc
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # pin@v6
with:
Expand All @@ -262,3 +295,6 @@ jobs:
tags: ${{ steps.meta-tools.outputs.tags }}
push: true
pull: true
build-args: |
GIT_REVISION=${{ env.GIT_REVISION }}
BUILD_DATE=${{ env.BUILD_DATE }}
Loading