Skip to content

Instantly share code, notes, and snippets.

@tumainimosha
Created July 1, 2021 14:01
Show Gist options
  • Save tumainimosha/d072e02c8f82643d8d044ad65b62dc4d to your computer and use it in GitHub Desktop.
Save tumainimosha/d072e02c8f82643d8d044ad65b62dc4d to your computer and use it in GitHub Desktop.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
# We are using chybie/node-aws-cli image which contains npm and aws-cli tools
#
# Also you need to specify AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY in
# pipeline environment variables for push to s3 to work
#
# Pipeline is configured to run only on master branch, but you can configure
# additional branches if required
# This is the stages / task to perfom in jobs
stages:
- build
- deploy
# Job One for making build
build_dev:
stage: build
type: build
image: cirrusci/flutter:dev-web
# caching for reuse
cache:
key: ${CI_PROJECT_ID}
paths:
- /home/cirrus/.pub-cache/
- .packages
script:
- flutter pub get
- flutter build web
only: ["master"]
tags:
- docker
artifacts:
paths:
- build/
expire_in: 1 hour
# Job Two for deploy build to S3
deploy_dev:
image: python:latest
stage: deploy
type: deploy
before_script:
- pip install awscli
script:
- aws s3 sync build/web/ s3://<bucket-name> --delete --region us-east-1
only: ["master"]
tags:
- docker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment