Skip to content

Commit

Permalink
Fix: ncp to aws s3 for docs
Browse files Browse the repository at this point in the history
  • Loading branch information
emost22 committed Jun 8, 2024
1 parent 07277ec commit 698900f
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,19 +78,28 @@ jobs:
upload_docs:
name: upload api docs
needs: pull_from_registry
needs: push_to_registry
runs-on: ubuntu-latest
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_KEY }}
AWS_REGION: ap-northeast-2

steps:
- name: Download Artifact
uses: actions/download-artifact@v3
with:
name: api-docs # Artifact name
path: artifact
- name: Upload Files to S3
name: api-docs

- name: Upload binary to S3 bucket
uses: jakejarvis/s3-sync-action@master
env:
AWS_ACCESS_KEY_ID: ${{ secrets.NCP_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.NCP_SECRET_KEY }}
AWS_DEFAULT_REGION: us-east-1
run: |
aws --endpoint-url=https://kr.object.ncloudstorage.com s3 cp artifact/index.html s3://spurt-backend-docs
aws --endpoint-url=https://kr.object.ncloudstorage.com/ s3 ls s3://spurt-backend-docs --recursive | awk '{cmd="aws --endpoint-url=https://kr.object.ncloudstorage.com/ s3api put-object-acl --bucket spurt-backend-docs --acl public-read --key "$4; system(cmd)}'
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET_NAME }}
SOURCE_DIR: .

- name: Invalidate cache CloudFront
uses: chetan/invalidate-cloudfront-action@master
env:
DISTRIBUTION: ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID }}
PATHS: '/*'
continue-on-error: true

0 comments on commit 698900f

Please sign in to comment.