Skip to content

Commit 04ec3ae

Browse files
Update CI-CD workflow: upgrade actions and rename master to main
1 parent e31343a commit 04ec3ae

File tree

1 file changed

+11
-39
lines changed

1 file changed

+11
-39
lines changed

.github/workflows/ci-cd.yml

Lines changed: 11 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- '**'
77
pull_request:
88
branches:
9-
- master
9+
- main
1010
- development
1111

1212
concurrency:
@@ -23,12 +23,12 @@ jobs:
2323
runs-on: ubuntu-latest
2424
steps:
2525
- name: Checkout code
26-
uses: actions/checkout@v4
26+
uses: actions/checkout@v5
2727
with:
2828
fetch-depth: 0
2929

30-
- name: Set up nodejs
31-
uses: actions/setup-node@v3
30+
- name: Set up Node.js
31+
uses: actions/setup-node@v6
3232
with:
3333
node-version: 'lts/*'
3434
cache: 'npm'
@@ -48,37 +48,9 @@ jobs:
4848
- name: Set VERSION env
4949
run: echo "VERSION=$(cat package.json | jq -r .version)" >> $GITHUB_ENV
5050

51-
- name: SonarQube Scan (Push)
52-
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/development')
53-
uses: SonarSource/sonarcloud-github-action@v1.9
54-
env:
55-
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
56-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57-
with:
58-
projectBaseDir: .
59-
args: >
60-
-Dsonar.host.url=${{ secrets.SONARQUBE_HOST }}
61-
-Dsonar.projectVersion=${{ env.VERSION }}
62-
-Dsonar.branch.name=${{ github.ref_name }}
63-
64-
- name: SonarQube Scan (Pull Request)
65-
if: github.event_name == 'pull_request'
66-
uses: SonarSource/sonarcloud-github-action@v1.9
67-
env:
68-
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
69-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
70-
with:
71-
projectBaseDir: .
72-
args: >
73-
-Dsonar.host.url=${{ secrets.SONARQUBE_HOST }}
74-
-Dsonar.projectVersion=${{ env.VERSION }}
75-
-Dsonar.pullrequest.key=${{ github.event.pull_request.number }}
76-
-Dsonar.pullrequest.branch=${{ github.event.pull_request.head.ref }}
77-
-Dsonar.pullrequest.base=${{ github.event.pull_request.base.ref }}
78-
7951
- name: Store assets
80-
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/development')
81-
uses: actions/upload-artifact@v3
52+
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/development')
53+
uses: actions/upload-artifact@v5
8254
with:
8355
name: assets
8456
path: umd/
@@ -100,7 +72,7 @@ jobs:
10072

10173
steps:
10274
- name: Download assets
103-
uses: actions/download-artifact@v3
75+
uses: actions/download-artifact@v6
10476
with:
10577
name: assets
10678
path: umd
@@ -110,7 +82,7 @@ jobs:
11082
working-directory: umd
11183

11284
- name: Configure AWS credentials
113-
uses: aws-actions/configure-aws-credentials@v1-node16
85+
uses: aws-actions/configure-aws-credentials@v4
11486
with:
11587
role-to-assume: arn:aws:iam::${{ matrix.account_id }}:role/gha-public-assets-role
11688
aws-region: us-east-1
@@ -127,7 +99,7 @@ jobs:
12799
name: Upload assets
128100
runs-on: ubuntu-latest
129101
needs: build
130-
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
102+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
131103
strategy:
132104
matrix:
133105
environment:
@@ -139,7 +111,7 @@ jobs:
139111

140112
steps:
141113
- name: Download assets
142-
uses: actions/download-artifact@v3
114+
uses: actions/download-artifact@v6
143115
with:
144116
name: assets
145117
path: umd
@@ -149,7 +121,7 @@ jobs:
149121
working-directory: umd
150122

151123
- name: Configure AWS credentials
152-
uses: aws-actions/configure-aws-credentials@v1-node16
124+
uses: aws-actions/configure-aws-credentials@v4
153125
with:
154126
role-to-assume: arn:aws:iam::${{ matrix.account_id }}:role/gha-public-assets-role
155127
aws-region: us-east-1

0 commit comments

Comments
 (0)