Skip to content

Instantly share code, notes, and snippets.

@NickChen14
Last active July 15, 2021 11:55
Show Gist options
  • Save NickChen14/d59792c97ab03504fe4a5270e053ff6f to your computer and use it in GitHub Desktop.
Save NickChen14/d59792c97ab03504fe4a5270e053ff6f to your computer and use it in GitHub Desktop.
CI/CD Godaddy Server
image: ubuntu:latest
cache:
paths:
# - vendor/
- .apt
- node_modules
deploy_godaddy:
stage: deploy
environment: Production
before_script:
- apt-get update -y
- apt-get -o dir::cache::archives=".apt"apt-get install sudo curl sshpass -y
- curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
- sudo apt-get install -y nodejs
- curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
- echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
- apt-get update -y
- sudo apt-get install --no-install-recommends yarn --allow-unauthenticated -y
- node -v
- yarn --version
- sshpass -V
# - npm install
script:
- yarn
- yarn build
after_script:
- cd dist/
- ls
- export SSHPASS=$USER_PASS
- sshpass -e scp -o stricthostkeychecking=no -r . $USER_NAME@$HOST:~/public_html/demo/ci-cd-godaddy
artifacts:
paths:
- dist
only:
- master
<template>
<div class="hello">
<h1>{{ msg }}</h1>
<h2>Build at: {{ VUE_APP_BUILD_TIME }}</h2>
<p>
For a guide and recipes on how to configure / customize this project,
<br>check out the
<a
href="https://cli.vuejs.org"
target="_blank"
rel="noopener"
>vue-cli documentation</a>.
</p>
<h3>Installed CLI Plugins</h3>
<ul>
<li>
<a
href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel"
target="_blank"
rel="noopener"
>babel</a>
</li>
<li>
<a
href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint"
target="_blank"
rel="noopener"
>eslint</a>
</li>
</ul>
<h3>Essential Links</h3>
<ul>
<li>
<a href="https://vuejs.org" target="_blank" rel="noopener">Core Docs</a>
</li>
<li>
<a href="https://forum.vuejs.org" target="_blank" rel="noopener">Forum</a>
</li>
<li>
<a href="https://chat.vuejs.org" target="_blank" rel="noopener">Community Chat</a>
</li>
<li>
<a href="https://twitter.com/vuejs" target="_blank" rel="noopener">Twitter</a>
</li>
<li>
<a href="https://news.vuejs.org" target="_blank" rel="noopener">News</a>
</li>
</ul>
<h3>Ecosystem</h3>
<ul>
<li>
<a href="https://router.vuejs.org" target="_blank" rel="noopener">vue-router</a>
</li>
<li>
<a href="https://vuex.vuejs.org" target="_blank" rel="noopener">vuex</a>
</li>
<li>
<a
href="https://github.com/vuejs/vue-devtools#vue-devtools"
target="_blank"
rel="noopener"
>vue-devtools</a>
</li>
<li>
<a href="https://vue-loader.vuejs.org" target="_blank" rel="noopener">vue-loader</a>
</li>
<li>
<a href="https://github.com/vuejs/awesome-vue" target="_blank" rel="noopener">awesome-vue</a>
</li>
</ul>
</div>
</template>
<script>
export default {
name: "HelloWorld",
props: {
msg: String
},
data: function() {
return {
VUE_APP_BUILD_TIME: process.env.VUE_APP_BUILD_TIME
};
}
};
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h3 {
margin: 40px 0 0;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
</style>
// vue.config.js
process.env.VUE_APP_BUILD_TIME = new Date();
module.exports = {
publicPath:
process.env.NODE_ENV === "production"
? "http://demo.nick-chen.com/ci-cd-godaddy/"
: "/"
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment