-
Notifications
You must be signed in to change notification settings - Fork 8
87 lines (67 loc) · 2.64 KB
/
main.yml
File metadata and controls
87 lines (67 loc) · 2.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
steps:
- uses: actions/checkout@v1
# - uses : actions-hub/docker/cli@master
# - uses: actions-hub/docker/login@master
# env:
# DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
# DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
# DOCKER_REGISTRY_URL: docker.pkg.github.com
- name: Cache node modules
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Node ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
# - name: Login to github registry
# uses: actions-hub/docker/login@master
# env:
# DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
# DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
# DOCKER_REGISTRY_URL: docker.pkg.github.com
# - name : build docker image
# uses : actions-hub/docker/cli@master
# with :
# args : build -t docker.pkg.github.com/${{ github.repository }}/angulardevops:0.1 .
# - name: Push to github registry
# uses: actions-hub/docker@master
# with:
# args: push docker.pkg.github.com/${{ github.repository }}/angulardevops:0.1
# - name : push to staging server with ssh
# env :
# SSHPASS : ${{ secrets.SSHPASS }}
# SERVER : ${{ secrets.SERVER}}
#run : |
# sudo apt-get update
# sudo apt-get install sshpass -y
# npm install -g @angular/cli@6.2
#npm ci --debug
#ng build --prod
#cd dist/my-first-app/
#sudo sshpass -p ${SSHPASS} -v ssh -o StrictHostKeyChecking=no root@${SERVER} 'rm -rf /usr/share/nginx/html/*'
#sudo sshpass -p ${SSHPASS} scp -v -o stricthostkeychecking=no -r *.* root@${SERVER}:/usr/share/nginx/html
- name: push to heroku
env :
HEROKU_REGISTRY_URL: registry.heroku.com
HEROKU_TOKEN : ${{ secrets.HEROKU_TOKEN }}
run : |
docker login --username=_ --password $HEROKU_TOKEN $HEROKU_REGISTRY_URL
export HEROKU_API_KEY=$HEROKU_TOKEN
heroku container:login
heroku container:push web --app angulardevops
heroku container:release web --app angulardevops
heroku ps:scale web=1 --app angulardevops