Skip to content

Commit 4c15cf9

Browse files
committed
#RI-6315 - release workflow doesn't run
1 parent f7c162c commit 4c15cf9

15 files changed

+249
-121
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Deploy Pages
2+
description: 'Download the artifact and deploy to GitHub Pages'
3+
4+
inputs:
5+
group:
6+
description: Group matching the artifacts
7+
required: false
8+
default: '*'
9+
10+
AWS_BUCKET_NAME_TEST:
11+
required: true
12+
AWS_DEFAULT_REGION:
13+
required: true
14+
AWS_DISTRIBUTION_ID:
15+
required: true
16+
AWS_ACCESS_KEY_ID:
17+
required: true
18+
AWS_SECRET_ACCESS_KEY:
19+
required: true
20+
21+
runs:
22+
using: 'composite'
23+
steps:
24+
25+
- name: Get current date
26+
id: date
27+
uses: ./.github/actions/get-current-date
28+
29+
- name: Download artifacts
30+
uses: actions/download-artifact@v4
31+
with:
32+
pattern: ${{ format('{0}*', inputs.group) }}
33+
path: public/${{ github.run_id }}
34+
35+
- name: Deploy 🚀
36+
shell: bash
37+
env:
38+
AWS_BUCKET_NAME_TEST: ${{ inputs.AWS_BUCKET_NAME_TEST }}
39+
AWS_DEFAULT_REGION: ${{ inputs.AWS_DEFAULT_REGION }}
40+
AWS_DISTRIBUTION_ID: ${{ inputs.AWS_DISTRIBUTION_ID }}
41+
AWS_ACCESS_KEY_ID: ${{ inputs.AWS_ACCESS_KEY_ID }}
42+
AWS_SECRET_ACCESS_KEY: ${{ inputs.AWS_SECRET_ACCESS_KEY }}
43+
run: |
44+
45+
SUB_PATH=test-reports/${{ steps.date.outputs.date }}
46+
47+
aws s3 cp public/ s3://${AWS_BUCKET_NAME_TEST}/public/${SUB_PATH} --recursive
48+
49+
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Remove all artifacts
2+
3+
runs:
4+
using: 'composite'
5+
steps:
6+
- name: Merge artifacts by pattern
7+
id: merge-artifacts
8+
uses: actions/upload-artifact/merge@v4
9+
with:
10+
name: remove-artifacts
11+
pattern: '*'
12+
delete-merged: true
13+
14+
- name: Delete merged artifact
15+
uses: actions/github-script@v7
16+
with:
17+
script: |
18+
github.rest.actions.deleteArtifact({
19+
owner: context.repo.owner,
20+
repo: context.repo.repo,
21+
artifact_id: ${{ steps.merge-artifacts.outputs.artifact-id }}
22+
});
23+

.github/generate-build-summary.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const fs = require('fs')
22
const path = require('path')
33

4-
const { writeFile } = fs.promises
4+
const { appendFile } = fs.promises
55

66
const { AWS_DEFAULT_REGION, AWS_BUCKET_NAME_TEST, SUB_PATH, GITHUB_STEP_SUMMARY } = process.env;
77

@@ -66,7 +66,7 @@ async function generateBuildSummary() {
6666
const data = markdownLines.join('\n')
6767
const summaryFilePath = GITHUB_STEP_SUMMARY
6868

69-
await writeFile(summaryFilePath, data, { encoding: 'utf8' })
69+
await appendFile(summaryFilePath, data, { encoding: 'utf8' })
7070

7171
console.log('Build summary generated successfully.')
7272

.github/workflows/aws-upload-dev.yml

Lines changed: 12 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -25,64 +25,35 @@ jobs:
2525
id: date
2626
uses: ./.github/actions/get-current-date
2727

28-
- name: Merge builds by pattern
29-
id: merge-builds
30-
uses: actions/upload-artifact/merge@v4
31-
with:
32-
name: 'all-builds'
33-
pattern: '*-builds'
34-
delete-merged: true
35-
3628
- name: Download builds
3729
uses: actions/download-artifact@v4
3830
with:
39-
name: 'all-builds'
31+
pattern: '*-builds'
4032
path: release
33+
merge-multiple: true
4134

4235
- run: ls -R ./release
4336

44-
- name: Set sub path for dev builds
37+
- name: Upload builds to s3 bucket dev sub folder
4538
if: ${{ !inputs.pre-release }}
4639
run: |
47-
echo "SUB_PATH=dev-builds/${{ steps.date.outputs.date }}/${{ github.run_id }}" >> $GITHUB_ENV
40+
SUB_PATH="dev-builds/${{ steps.date.outputs.date }}/${{ github.run_id }}"
41+
echo "SUB_PATH=${SUB_PATH}" >> $GITHUB_ENV
4842
49-
- name: Set sub path for pre-release builds and copy to upgrades folder
43+
aws s3 cp release/ s3://${AWS_BUCKET_NAME_TEST}/public/${SUB_PATH} --recursive
44+
45+
- name: Upload builds to s3 bucket pre-releasea sub folder
5046
if: inputs.pre-release
5147
run: |
5248
APP_VERSION=$(jq -r '.version' redisinsight/package.json)
53-
echo "SUB_PATH=pre-release/${APP_VERSION}" >> $GITHUB_ENV
49+
SUB_PATH="pre-release/${APP_VERSION}"
5450
55-
aws s3 cp release/ s3://${AWS_BUCKET_NAME_TEST}/public/upgrades --recursive
51+
echo "SUB_PATH=${SUB_PATH}" >> $GITHUB_ENV
5652
57-
- name: Upload builds to s3 bucket
58-
run: |
59-
aws s3 cp release/ s3://${AWS_BUCKET_NAME_TEST}/public/${SUB_PATH} --recursive
53+
aws s3 cp release/ s3://${AWS_BUCKET_NAME_TEST}/public/upgrades --recursive
54+
aws s3 cp release/ s3://${AWS_BUCKET_NAME_TEST}/public/pre-release/${APP_VERSION} --recursive
6055
6156
- name: Generate job summary
6257
run: |
6358
node ./.github/generate-build-summary.js
6459
65-
# Remove artifacts from github actions
66-
remove-artifacts:
67-
name: Remove artifacts
68-
needs: 's3'
69-
runs-on: ubuntu-latest
70-
71-
steps:
72-
- name: Merge artifacts by pattern
73-
id: merge-artifacts
74-
uses: actions/upload-artifact/merge@v4
75-
with:
76-
name: remove-artifacts
77-
pattern: '*'
78-
delete-merged: true
79-
80-
- name: Delete merged artifact
81-
uses: actions/github-script@v7
82-
with:
83-
script: |
84-
github.rest.actions.deleteArtifact({
85-
owner: context.repo.owner,
86-
repo: context.repo.repo,
87-
artifact_id: ${{ steps.merge-artifacts.outputs.artifact-id }}
88-
});

.github/workflows/aws-upload-prod.yml

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -41,31 +41,6 @@ jobs:
4141
4242
aws s3 cp release/ s3://${AWS_BUCKET_NAME}/private/${applicationVersion} --recursive
4343
44-
# Remove artifacts from github actions
45-
remove-artifacts:
46-
name: Remove artifacts
47-
needs: 'release-private'
48-
runs-on: ubuntu-latest
49-
50-
steps:
51-
- name: Merge artifacts by pattern
52-
id: merge-artifacts
53-
uses: actions/upload-artifact/merge@v4
54-
with:
55-
name: remove-artifacts
56-
pattern: '*'
57-
delete-merged: true
58-
59-
- name: Delete merged artifact
60-
uses: actions/github-script@v7
61-
with:
62-
script: |
63-
github.rest.actions.deleteArtifact({
64-
owner: context.repo.owner,
65-
repo: context.repo.repo,
66-
artifact_id: ${{ steps.merge-artifacts.outputs.artifact-id }}
67-
});
68-
6944
release-public:
7045
name: Release s3 public
7146
runs-on: ubuntu-latest

.github/workflows/clean-s3-dev-builds.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@ jobs:
1313
deleting:
1414
runs-on: ubuntu-latest
1515
steps:
16-
- name: Deleting builds older than 7 days
16+
- name: Deleting builds and test reports older than 7 days
1717
continue-on-error: true
1818
run: |
1919
DATE=$(date +'%Y-%m-%d')
2020
DATE_EPIRED=$(date -d "$DATE - 7 days" +'%Y-%m-%d')
2121
2222
aws s3 rm s3://${AWS_BUCKET_NAME_TEST}/public/dev-builds/${DATE_EPIRED} --recursive
23+
aws s3 rm s3://${AWS_BUCKET_NAME_TEST}/public/test-reports/${DATE_EPIRED} --recursive
2324

.github/workflows/manual-build.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,15 @@ jobs:
9898
needs: [aws-upload]
9999
if: always()
100100

101+
# Remove artifacts from github actions
102+
remove-artifacts:
103+
name: Remove artifacts
104+
needs: [aws-upload]
105+
if: always()
106+
runs-on: ubuntu-latest
107+
108+
steps:
109+
- name: Remove all artifacts
110+
uses: ./.github/actions/remove-artifacts
111+
112+

.github/workflows/release-prod.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,13 @@ jobs:
5555
needs: aws-upload-prod
5656
secrets: inherit
5757

58-
# Cancel a previous run workflow
59-
concurrency:
60-
group: ${{ github.workflow }}-${{ github.ref }}
61-
cancel-in-progress: true
58+
# Remove artifacts from github actions
59+
remove-artifacts:
60+
name: Remove artifacts
61+
needs: [aws-upload-prod, e2e-docker-tests, e2e-appimage-tests]
62+
if: always()
63+
runs-on: ubuntu-latest
64+
65+
steps:
66+
- name: Remove all artifacts
67+
uses: ./.github/actions/remove-artifacts

.github/workflows/release-stage.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
aws:
2727
uses: ./.github/workflows/aws-upload-dev.yml
2828
needs: [builds]
29+
secrets: inherit
2930
if: always()
3031
with:
3132
pre-release: true
@@ -40,7 +41,13 @@ jobs:
4041
uses: ./.github/workflows/tests-e2e-appimage.yml
4142
secrets: inherit
4243

43-
# Cancel a previous run workflow
44-
concurrency:
45-
group: ${{ github.workflow }}-${{ github.ref }}
46-
cancel-in-progress: true
44+
# Remove artifacts from github actions
45+
remove-artifacts:
46+
name: Remove artifacts
47+
needs: [aws, e2e-docker-tests, e2e-appimage-tests]
48+
if: always()
49+
runs-on: ubuntu-latest
50+
51+
steps:
52+
- name: Remove all artifacts
53+
uses: ./.github/actions/remove-artifacts # Remove artifacts from github actions

.github/workflows/tests-backend.yml

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,12 @@ on:
1111
env:
1212
SLACK_AUDIT_REPORT_CHANNEL: ${{ secrets.SLACK_AUDIT_REPORT_CHANNEL }}
1313
SLACK_AUDIT_REPORT_KEY: ${{ secrets.SLACK_AUDIT_REPORT_KEY }}
14-
DEFAULT_GITHUB_PAGES_URL: ${{ vars.DEFAULT_GITHUB_PAGES_URL }}
1514
REPORT_NAME: "report-be"
1615

1716
jobs:
1817
unit-tests:
1918
name: Unit tests
2019
runs-on: ubuntu-latest
21-
environment:
22-
name: staging
23-
url: ${{ env.DEFAULT_GITHUB_PAGES_URL }}/${{ github.run_id }}/${{ env.REPORT_NAME }}
2420
steps:
2521
- uses: actions/checkout@v4
2622

@@ -64,10 +60,24 @@ jobs:
6460
name: ${{ env.REPORT_NAME }}
6561
path: redisinsight/api/report
6662

67-
deploy-pages:
68-
name: Deploy report
69-
uses: ./.github/workflows/deploy-pages.yml
70-
needs: 'unit-tests'
71-
if: always()
72-
with:
73-
group: 'report'
63+
- name: Deploy report
64+
uses: ./.github/actions/deploy-test-reports
65+
if: always()
66+
with:
67+
group: 'report'
68+
AWS_BUCKET_NAME_TEST: ${{ vars.AWS_BUCKET_NAME_TEST }}
69+
AWS_DEFAULT_REGION: ${{ vars.AWS_DEFAULT_REGION }}
70+
AWS_DISTRIBUTION_ID: ${{ secrets.AWS_DISTRIBUTION_ID }}
71+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
72+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
73+
74+
- name: Get current date
75+
id: date
76+
if: always()
77+
uses: ./.github/actions/get-current-date
78+
79+
- name: Add link to report in the workflow summary
80+
if: always()
81+
run: |
82+
link="${{ vars.DEFAULT_TEST_REPORTS_URL }}/${{ steps.date.outputs.date }}/${{ github.run_id }}/${{ env.REPORT_NAME }}/index.html"
83+
echo "[${link}](${link})" >> $GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)