Skip to content

Commit

Permalink
added "is_latest" input for "build" workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ashkuc committed Mar 1, 2024
1 parent 624f0c9 commit b1e9a61
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 8 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/build-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: Build and push docker images

on:
workflow_dispatch:
inputs:
is_latest:
type: string
description: should add latest tag
default: "false"

jobs:
build-crawler:
Expand All @@ -11,10 +16,12 @@ jobs:
with:
tag: scan-backend-crawler
dockerfile: Dockerfile.crawler
is_latest: ${{ github.event.inputs.is_latest }}

build-web-api:
name: Build Web API
uses: ./.github/workflows/build-docker-image.yml
secrets: inherit
with:
tag: scan-backend-web-api
is_latest: ${{ github.event.inputs.is_latest }}
18 changes: 13 additions & 5 deletions .github/workflows/build-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ on:
type: string
description: tag
required: true
push:
type: boolean
description: is push
default: false
dockerfile:
type: string
description: dockerfile path
Expand All @@ -23,6 +19,10 @@ on:
type: string
description: build target
required: false
is_latest:
type: string
description: should add latest tag
default: false

jobs:
docker:
Expand All @@ -46,4 +46,12 @@ jobs:
with:
file: ${{ inputs.dockerfile }}
push: true
tags: ${{ inputs.image }}:${{ inputs.tag }}-${{ github.sha }},${{ inputs.image }}:${{ inputs.tag }}-latest
tags: ${{ inputs.image }}:${{ inputs.tag }}-${{ github.sha }}
-
name: Build and push latest
if: ${{ inputs.is_latest == 'true' }}
uses: docker/build-push-action@v4
with:
file: ${{ inputs.dockerfile }}
push: true
tags: ${{ inputs.image }}:${{ inputs.tag }}-latest
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "polkastats-backend-uniquenetwork",
"version": "2.0.74",
"version": "2.0.75",
"description": "",
"author": "Unique Network Team",
"private": true,
Expand Down

0 comments on commit b1e9a61

Please sign in to comment.