Created
March 31, 2018 17:33
-
-
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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