thamaraaalves
10/7/2019 - 12:32 AM

GITLAB-CI S3 SCRIPT

stages:
  - build
  - deploy

build prod:
  image: node:10.15.0-stretch
  stage: build
  only:
    - tags
  script:
    # Install vuecli
    - npm install -g @vue/cli@latest
    # Install dependencies
    - npm install
    # Build App
    - npm run build
  artifacts:
    paths:
      # Build folder
      - dist/
    expire_in: 1 hour

deploy prod:
  image: python:latest
  stage: deploy
  only:
    - tags
  script:
    - pip install awscli
    - aws s3 sync ./dist s3://BUCKETNAME

build stage:
  image: node:10.15.0-stretch
  stage: build
  only:
    - master
  script:
    # Install vuecli
    - npm install -g @vue/cli@latest
    # Install dependencies
    - npm install
    # Build App
    - npm run build
  artifacts:
    paths:
      # Build folder
      - dist/
    expire_in: 1 hour

deploy stage:
  image: python:latest
  stage: deploy
  only:
    - master
  script:
    - pip install awscli
    - aws s3 sync ./dist s3://BUCKETNAME