Skip to content
Draft
21 changes: 21 additions & 0 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <<EOF
-mkdir halstack/$MAJOR_VERSION
put -r ./apps/website/out/* halstack/$MAJOR_VERSION/
EOF
39 changes: 17 additions & 22 deletions .github/workflows/publish-website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,20 @@ 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: Move website to S3
# run: |
# aws s3 rm s3://design-system-react-cdk-site/halstack/next/ --recursive
# aws s3 cp ./apps/website/out/ s3://design-system-react-cdk-site/halstack/next/ --recursive
- name: Deploy via SFTP
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
SFTP_HOST: ${{ secrets.SFTP_HOST }}
SFTP_USER: ${{ secrets.SFTP_USER }}
run: |
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 <<EOF
put -r ./apps/website/out/* halstack/next/
EOF
2 changes: 2 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
run: npm install

- name: Build library and website
env:
NEXT_PUBLIC_SITE_VERSION: next
run: npm run build

- name: Test library
Expand Down
Loading