Merge pull request #1544 from kintone-labs/SSR-4599_hot-fix_update-md… #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Amplify Document Staging Environment | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
publishOnMasterCommit: | |
name: Deploying on Amplify Document Staging Environment | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
contents: read | |
env: | |
ZIP_FILE_NAME: build_staging | |
BRANCH_NAME: staging | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'npm' | |
- name: Install dependencies on root | |
run: npm ci | |
- name: Build umd file | |
run: npm run build:umd_prod | |
- name: Move umd file | |
run: mv umd/kuc.min.js docs/document/static/js | |
- name: Install dependencies on document | |
run: npm ci | |
working-directory: docs/document | |
- name: Replace kucLink | |
run: sed -i 's|https://unpkg.com/kintone-ui-component/umd/kuc.min.js|/js/kuc.min.js|' docusaurus.config.js | |
working-directory: docs/document | |
- name: Build document | |
run: npm run build | |
working-directory: docs/document | |
- name: Create deployment zip file | |
run: zip -r $ZIP_FILE_NAME * | |
working-directory: docs/document/build | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: ${{ secrets.AWS_OIDC_ROLE_ARN }} | |
aws-region: ${{ secrets.AWS_DOCUMENT_REGION }} | |
mask-aws-account-id: true | |
- name: Create Amplify deployment | |
id: create_deployment | |
run: | | |
output=$(aws amplify create-deployment --app-id ${{ secrets.AWS_DOCUMENT_APP_ID }} --branch-name $BRANCH_NAME) | |
echo "job_id=$(echo $output | jq -r '.jobId')" >> $GITHUB_OUTPUT | |
echo "zip_upload_url=$(echo $output | jq -r '.zipUploadUrl')" >> $GITHUB_OUTPUT | |
- name: Upload deployment zip file | |
run: | | |
curl \ | |
-X PUT \ | |
-H "Content-Type: application/zip" \ | |
--upload-file "$ZIP_FILE_NAME".zip \ | |
"${{ steps.create_deployment.outputs.zip_upload_url }}" | |
working-directory: docs/document/build | |
- name: Start Amplify deployment | |
run: | | |
aws amplify start-deployment \ | |
--app-id ${{ secrets.AWS_DOCUMENT_APP_ID }} \ | |
--branch-name $BRANCH_NAME \ | |
--job-id ${{ steps.create_deployment.outputs.job_id }} |