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

Vcst-1109 #2791

Open
wants to merge 18 commits into
base: dev
Choose a base branch
from
Open
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
13 changes: 11 additions & 2 deletions .github/workflows/platform-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ on:
- '**/argoDeploy.json'
- '**/cloudDeploy.json'
branches: [ master, dev ]
pull_request:
paths-ignore:
#- '.github/**' # enable before merge
- 'docs/**'
- 'build/**'
- 'README.md'
- 'LICENSE'
- '**/argoDeploy.json'
- '**/cloudDeploy.json'

jobs:
ci:
Expand Down Expand Up @@ -210,7 +219,7 @@ jobs:
with:
artifactUrl: ${{ steps.artifactUrl.outputs.DOCKER_URL }}
repoOrg: ${{ github.repository_owner }}
downloadComment: 'Artifact URL:'
downloadComment: 'Image tag:'

- name: Publish Github Release
if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' }}
Expand Down Expand Up @@ -311,4 +320,4 @@ jobs:
jiraKeys: ${{ needs.ci.outputs.jira-keys }}
argoServer: 'argo.virtocommerce.cloud'
matrix: '{"include":${{ needs.ci.outputs.matrix }}}'
secrets: inherit
secrets: inherit
101 changes: 88 additions & 13 deletions .github/workflows/pr-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ name: Platform PR build

on:
workflow_dispatch:
pull_request:
branches: [ master, dev ]
paths-ignore:
- '.github/**'
- 'docs/**'
- 'build/**'
- 'README.md'
- 'LICENSE'
- '**/argoDeploy.json'
- '**/cloudDeploy.json'
# pull_request:
# branches: [ master, dev ]
# paths-ignore:
# #- '.github/**'
# - 'docs/**'
# - 'build/**'
# - 'README.md'
# - 'LICENSE'
# - '**/argoDeploy.json'
# - '**/cloudDeploy.json'

jobs:
test:
Expand All @@ -28,17 +28,92 @@ jobs:
secrets:
envPAT: ${{ secrets.REPO_TOKEN }}

publish:
runs-on: ubuntu-latest
needs:
build
env:
DOCKER_TAR: ${{ needs.build.outputs.dockerTar }}
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}
PACKAGE_SERVER: 'ghcr.io'
PUBLISH_TO_DOCKER: false
UPDATE_LATEST_TAG: false
steps:
- name: Get Docker image from cache
uses: actions/cache@v4
id: restore-build
with:
key: ${{ needs.build.outputs.dockerFullKey }}
restore-keys: '${{ needs.build.outputs.dockerShortKey }}-'
path: |
${{ env.DOCKER_TAR }}

- name: Check cache status # Warn workflow if fullKey not present
if: steps.restore-build.outputs.cache-hit != 'true'
run: |
echo -e "\033[33mWarning: Cache not found for input keys: ${{ needs.build.outputs.dockerFullKey }}. The cache may have been restored from alternative key '${{ needs.build.outputs.dockerShortKey }}-'"

- name: Load Docker image
id: load-docker
uses: VirtoCommerce/vc-github-actions/docker-load-image@master
with:
dockerTar: ${{ env.DOCKER_TAR }}

# - name: Docker Login
# uses: docker/login-action@v3
# with:
# registry: ${{ env.PACKAGE_SERVER }}
# username: $GITHUB_ACTOR
# password: ${{ env.GITHUB_TOKEN }}

# - name: Push to GH
# run: |
# docker login --username $GITHUB_ACTOR --password ${{ env.GITHUB_TOKEN }} ${{ env.PACKAGE_SERVER }}
# docker push ${{ steps.load-docker.outputs.image }}:${{ steps.load-docker.outputs.tag }}

- name: Publish Docker Image
uses: VirtoCommerce/vc-github-actions/publish-docker-image@master
with:
image: ${{ steps.load-docker.outputs.image }}
tag: ${{ steps.load-docker.outputs.tag }}
docker_user: ${{ secrets.DOCKER_USERNAME }}
docker_token: ${{ env.GITHUB_TOKEN }} # ${{ secrets.DOCKER_TOKEN }}
docker_hub: ${{ env.PUBLISH_TO_DOCKER }}
update_latest: ${{ env.UPDATE_LATEST_TAG }}


# uses: VirtoCommerce/.github/.github/workflows/[email protected]
# with:
# fullKey: ${{ needs.build.outputs.dockerFullKey }}
# shortKey: '${{ needs.build.outputs.dockerShortKey }}-'
# dockerTar: ${{ needs.build.outputs.dockerTar }}
# publishToDocker: true
# secrets:
# envPAT: ${{ secrets.REPO_TOKEN }}
# # dockerUser: $GITHUB_ACTOR
# # dockerToken: ${{ secrets.REPO_TOKEN }}
# dockerUser: ${{ secrets.DOCKER_USERNAME }}
# dockerToken: ${{ secrets.DOCKER_TOKEN }}

publish-tag:
needs: build
needs: publish
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}
ARTIFACT_NAME: 'platform'
steps:
# - name: Get cache key
# uses: VirtoCommerce/vc-github-actions/cache-get-key@master
# id: cache-key
# with:
# runnerOs: ${{ runner.os }}
# artifactName: ${{ env.ARTIFACT_NAME }}

- name: publish-tag
if: ${{ github.event_name == 'pull_request' }}
uses: VirtoCommerce/vc-github-actions/publish-artifact-link@master
with:
artifactUrl: ${{ needs.build.outputs.imageTag}}
artifactUrl: ${{ needs.publish.outputs.tag}}
repoOrg: ${{ github.repository_owner }}
downloadComment: 'Image tag:'
githubToken: ${{ env.GITHUB_TOKEN }}
githubToken: ${{ env.GITHUB_TOKEN }}
Loading