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

[ACA-4722] - fix publish image script #3511

Merged
merged 1 commit into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .github/actions/get-image-tag/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ runs:
if [[ "${{ inputs.branch_name }}" == "master" ]]; then
TAG_VERSION="$(jq -cr '.version' < package.json)"
else
TAG_VERSION="${{ inputs.branch_name }}-${{ github.run_id }},${{ inputs.branch_name }}"
TAG_VERSION="${{ inputs.branch_name }}-${{ github.run_id }}"
fi
echo "TAG_VERSION=$TAG_VERSION" >> $GITHUB_ENV
22 changes: 6 additions & 16 deletions .github/actions/publish-image/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,18 @@ inputs:
registry:
description: 'Docker registry'
required: true
type: string
username:
description: 'login username'
required: true
type: string
password:
description: 'login password'
required: true
type: string
branch_name:
description: 'Name of the branch the workflow runs on'
required: true
type: string
dry-run:
description: dry run flag
description: 'dry run flag'
required: true
tag_version:
description: 'tag version'
required: true
type: boolean

runs:
using: "composite"
Expand All @@ -39,11 +34,6 @@ runs:
username: ${{ inputs.username }}
password: ${{ inputs.password }}

- name: Get Tag
uses: ./.github/actions/get-image-tag
with:
branch_name: ${{ inputs.branch_name }}

- name: Install dependencies and build project
shell: bash
run: |
Expand All @@ -55,5 +45,5 @@ runs:
with:
context: .
platforms: linux/amd64,linux/arm64
push: ${{ github.event.inputs.dry-run != 'true' }}
tags: ${{ inputs.registry }}/alfresco/alfresco-content-app:${{ env.TAG_VERSION }}
push: ${{ inputs.dry-run != 'true' }}
tags: ${{ inputs.registry }}/alfresco/alfresco-content-app:${{ inputs.tag_version }}
16 changes: 14 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,17 @@ jobs:
node-version-file: '.nvmrc'
cache: 'npm'
- uses: ./.github/actions/setup

- name: Get Tag
uses: ./.github/actions/get-image-tag
with:
branch_name: ${{ env.BRANCH_NAME }}

- name: publish
uses: ./.github/actions/publish-image
with:
branch_name: ${{ env.BRANCH_NAME }}
registry: quay.io
tag_version: ${{ env.TAG_VERSION }}
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
dry-run: ${{ inputs.dry-run-release }}
Expand All @@ -60,11 +66,17 @@ jobs:
node-version-file: '.nvmrc'
cache: 'npm'
- uses: ./.github/actions/setup

- name: Get Tag
uses: ./.github/actions/get-image-tag
with:
branch_name: ${{ env.BRANCH_NAME }}

- name: publish
uses: ./.github/actions/publish-image
with:
branch_name: ${{ env.BRANCH_NAME }}
registry: docker.io
tag_version: ${{ env.TAG_VERSION }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
dry-run: ${{ inputs.dry-run-release }}
Expand Down
Loading