Skip to content

Instantly share code, notes, and snippets.

@ghostfreak3000
Created March 31, 2018 17:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ghostfreak3000/49447dfa599960f29d63bec1f0d43043 to your computer and use it in GitHub Desktop.
Save ghostfreak3000/49447dfa599960f29d63bec1f0d43043 to your computer and use it in GitHub Desktop.
Basic .gitlab-ci.yml config setup for static website ci pipeline (installs yarn deps, compiles sass then copies files to server web dir)
image: node:8
deploy-to-aws:
stage: deploy
script:
- apt-get update
- apt-get -y install apt-transport-https
- curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
- echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
- apt-get update
- apt-get -y install openssh-client rsync yarn ruby-full
- gem install sass --no-user-install
- yarn install
- sass app.scss:app.css
- ls
- chmod 600 ci_key.pem
- mkdir ~/deploy
- cp -r . ~/deploy
- ls -a ~/deploy
- rm ~/deploy/ci_key.pem
- rm -r ~/deploy/.git*
- ls -a ~/deploy
- rsync -Pavze "ssh -i ci_key.pem -o 'StrictHostKeyChecking=no'" ~/deploy/ $username@$host:$webapp_dir
only:
- deploy-to-aws
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment