vue-cli-3で作成したアプリを、bitbucket pipelinesでS3にデプロイする方法


参考

bitbucket-pipelines.yml

image: node:10.15.3

pipelines:
  branches:
    master:
      - step:
          name: Build
          caches:
            - node
          script: # Modify the commands below to build your repository.
            - yarn
            - yarn run build --mode staging
          artifacts:
            -dist/**
      - step:
          name: Deploy to S3
          deployment: staging
          script:
            - pipe: atlassian/aws-s3-deploy:0.4.1
              variables:
                AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
                AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
                AWS_DEFAULT_REGION: "us-west-1"
                S3_BUCKET: "YOUR_BUCKET_NAME"
                LOCAL_PATH: "dist"
                ACL: "public-read"

  • この例ではステージング環境にデプロイします。
  • masterブランチにマージした時のみパイプラインを実行します。