From ddcc50d97298b9d7e3d41418e8c6c4fc5a87eae1 Mon Sep 17 00:00:00 2001 From: Jialecl Date: Wed, 27 May 2026 13:11:39 +0200 Subject: [PATCH 01/12] Testing workflow change --- .github/workflows/pull-request.yml | 34 ++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 66022d185a..d14f323190 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -1,6 +1,11 @@ -name: Build and test +name: Publish Next Version -on: pull_request +on: + push: + branches: + - master + paths: + - "packages/lib/**" jobs: build: @@ -16,10 +21,22 @@ jobs: node-version: 22.x registry-url: https://registry.npmjs.org/ + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: us-west-2 + role-to-assume: ${{ secrets.AWS_ROLE_SANDBOX }} + role-duration-seconds: 3600 + role-skip-session-tagging: true + - name: Install dependencies run: npm install - name: Build library and website + env: + NEXT_PUBLIC_SITE_VERSION: next run: npm run build - name: Test library @@ -27,3 +44,16 @@ jobs: - name: Test library accessibility run: npm run test:accessibility + + - name: Publish NEXT version to npm + run: | + sed -i "s#\"version\": \".*\"#\"version\": \"$(jq -r .version ./packages/lib/package.json)-${GITHUB_SHA:0:7}\"#" ./packages/lib/package.json + cd packages/lib + npm publish --tag next --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} + + - name: Move NEXT website to S3 + run: | + aws s3 rm s3://design-system-react-cdk-site-tmp/halstack/next/ --recursive + aws s3 cp ./apps/website/out/ s3://design-system-react-cdk-site-tmp/halstack/next/ --recursive From 07f806ef0f18f3d9178064f0c44e59a8ecf48402 Mon Sep 17 00:00:00 2001 From: Jialecl Date: Wed, 27 May 2026 13:13:47 +0200 Subject: [PATCH 02/12] reverting workflow name and trigger --- .github/workflows/pull-request.yml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index d14f323190..f5b136be3d 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -1,11 +1,6 @@ -name: Publish Next Version - -on: - push: - branches: - - master - paths: - - "packages/lib/**" +name: Build and test + +on: pull_request jobs: build: From c5d1baece11a5ad066db7f42d5c0fca08ff30d72 Mon Sep 17 00:00:00 2001 From: Jialecl Date: Wed, 27 May 2026 13:47:15 +0200 Subject: [PATCH 03/12] Change secret variable --- .github/workflows/pull-request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index f5b136be3d..1dbf898229 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -22,7 +22,7 @@ jobs: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-region: us-west-2 - role-to-assume: ${{ secrets.AWS_ROLE_SANDBOX }} + role-to-assume: ${{ secrets.AWS_ROLE_PROD }} role-duration-seconds: 3600 role-skip-session-tagging: true From a026d5b07973b7186707d048e80d47bde4bc1193 Mon Sep 17 00:00:00 2001 From: Jialecl Date: Thu, 4 Jun 2026 08:45:40 +0200 Subject: [PATCH 04/12] Changing to v4 --- .github/workflows/pull-request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 1dbf898229..63d3e59552 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -17,7 +17,7 @@ jobs: registry-url: https://registry.npmjs.org/ - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 + uses: aws-actions/configure-aws-credentials@v4 with: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} From 4a4b6bcd917c47d35743d92c4a23c9b885c0e7cc Mon Sep 17 00:00:00 2001 From: jialecl Date: Thu, 27 Aug 2026 11:01:43 +0200 Subject: [PATCH 05/12] Workflow updated to connect through SFTP --- .github/workflows/pull-request.yml | 31 +++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 63d3e59552..343121d656 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -16,16 +16,6 @@ jobs: node-version: 22.x registry-url: https://registry.npmjs.org/ - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: us-west-2 - role-to-assume: ${{ secrets.AWS_ROLE_PROD }} - role-duration-seconds: 3600 - role-skip-session-tagging: true - - name: Install dependencies run: npm install @@ -48,7 +38,22 @@ jobs: env: NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} - - name: Move NEXT website to S3 + - name: Deploy via SFTP + env: + SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} + SFTP_HOST: ${{ secrets.SFTP_HOST }} + SFTP_USER: ${{ secrets.SFTP_USER }} run: | - aws s3 rm s3://design-system-react-cdk-site-tmp/halstack/next/ --recursive - aws s3 cp ./apps/website/out/ s3://design-system-react-cdk-site-tmp/halstack/next/ --recursive + mkdir -p ~/.ssh + + echo "$SSH_PRIVATE_KEY" | tr -d '\r' > ~/.ssh/ssh_file.pem + + chmod 600 ~/.ssh/ssh_file.pem + + ssh-keyscan -H -p 22 $SFTP_HOST >> ~/.ssh/known_hosts + + sftp -i ~/.ssh/ssh_file.pem -b - $SFTP_USER@$SFTP_HOST < Date: Thu, 27 Aug 2026 11:21:29 +0200 Subject: [PATCH 06/12] Avoid creating a next version for now --- .github/workflows/pull-request.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 343121d656..27da2c2c17 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -30,13 +30,13 @@ jobs: - name: Test library accessibility run: npm run test:accessibility - - name: Publish NEXT version to npm - run: | - sed -i "s#\"version\": \".*\"#\"version\": \"$(jq -r .version ./packages/lib/package.json)-${GITHUB_SHA:0:7}\"#" ./packages/lib/package.json - cd packages/lib - npm publish --tag next --access public - env: - NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} + # - name: Publish NEXT version to npm + # run: | + # sed -i "s#\"version\": \".*\"#\"version\": \"$(jq -r .version ./packages/lib/package.json)-${GITHUB_SHA:0:7}\"#" ./packages/lib/package.json + # cd packages/lib + # npm publish --tag next --access public + # env: + # NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} - name: Deploy via SFTP env: From 60b686845363061583f19b2aefe41265c9dcb78b Mon Sep 17 00:00:00 2001 From: jialecl Date: Thu, 27 Aug 2026 11:39:23 +0200 Subject: [PATCH 07/12] paths updated --- .github/workflows/pull-request.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 27da2c2c17..147580c2d0 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -53,7 +53,7 @@ jobs: ssh-keyscan -H -p 22 $SFTP_HOST >> ~/.ssh/known_hosts sftp -i ~/.ssh/ssh_file.pem -b - $SFTP_USER@$SFTP_HOST < Date: Thu, 27 Aug 2026 12:58:42 +0200 Subject: [PATCH 08/12] Changing copy to PUT --- .github/workflows/pull-request.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 147580c2d0..f54bc7e72f 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -54,6 +54,5 @@ jobs: sftp -i ~/.ssh/ssh_file.pem -b - $SFTP_USER@$SFTP_HOST < Date: Thu, 27 Aug 2026 13:02:37 +0200 Subject: [PATCH 09/12] avoid errors in case the folder does not exist --- .github/workflows/pull-request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index f54bc7e72f..6166ecdff3 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -53,6 +53,6 @@ jobs: ssh-keyscan -H -p 22 $SFTP_HOST >> ~/.ssh/known_hosts sftp -i ~/.ssh/ssh_file.pem -b - $SFTP_USER@$SFTP_HOST < Date: Fri, 28 Aug 2026 09:03:18 +0200 Subject: [PATCH 10/12] Test major creation --- .github/workflows/pull-request.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 6166ecdff3..8eea0c4371 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -53,6 +53,5 @@ jobs: ssh-keyscan -H -p 22 $SFTP_HOST >> ~/.ssh/known_hosts sftp -i ~/.ssh/ssh_file.pem -b - $SFTP_USER@$SFTP_HOST < Date: Fri, 28 Aug 2026 09:12:06 +0200 Subject: [PATCH 11/12] Create directory before deploying via SFTP --- .github/workflows/pull-request.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 8eea0c4371..1de868921a 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -53,5 +53,6 @@ jobs: ssh-keyscan -H -p 22 $SFTP_HOST >> ~/.ssh/known_hosts sftp -i ~/.ssh/ssh_file.pem -b - $SFTP_USER@$SFTP_HOST < Date: Fri, 28 Aug 2026 09:52:48 +0200 Subject: [PATCH 12/12] Removed tests and added final workflows --- .github/workflows/publish-release.yml | 21 +++++++++++++++ .github/workflows/publish-website.yml | 39 ++++++++++++--------------- .github/workflows/pull-request.yml | 27 ------------------- 3 files changed, 38 insertions(+), 49 deletions(-) diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 2da8e4a70f..73cf4ec942 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -38,3 +38,24 @@ jobs: env: NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} TAG_NAME: ${{ github.event.release.tag_name }} + + - name: Deploy via SFTP + env: + SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} + SFTP_HOST: ${{ secrets.SFTP_HOST }} + SFTP_USER: ${{ secrets.SFTP_USER }} + run: | + MAJOR_VERSION="${TAG_NAME%%.*}" + echo "Target folder: halstack/$MAJOR_VERSION/" + mkdir -p ~/.ssh + + echo "$SSH_PRIVATE_KEY" | tr -d '\r' > ~/.ssh/ssh_file.pem + + chmod 600 ~/.ssh/ssh_file.pem + + ssh-keyscan -H -p 22 $SFTP_HOST >> ~/.ssh/known_hosts + + sftp -i ~/.ssh/ssh_file.pem -b - $SFTP_USER@$SFTP_HOST < ~/.ssh/ssh_file.pem + + chmod 600 ~/.ssh/ssh_file.pem + + ssh-keyscan -H -p 22 $SFTP_HOST >> ~/.ssh/known_hosts + + sftp -i ~/.ssh/ssh_file.pem -b - $SFTP_USER@$SFTP_HOST < ~/.ssh/ssh_file.pem - - chmod 600 ~/.ssh/ssh_file.pem - - ssh-keyscan -H -p 22 $SFTP_HOST >> ~/.ssh/known_hosts - - sftp -i ~/.ssh/ssh_file.pem -b - $SFTP_USER@$SFTP_HOST <