-
Notifications
You must be signed in to change notification settings - Fork 3
60 lines (58 loc) · 3.13 KB
/
hugo-ci-workflow.yml
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
name: Hugo-CI
on:
push:
branches: [ master, qa ]
paths-ignore:
'.github/**'
jobs:
job-one:
name: Deploy_to_production
runs-on: [self-hosted, linux, x64, dev4-barcode]
if: github.ref == 'refs/heads/master'
steps:
- name: hugo build
run: |
cd aspose-barcode-docs
git clone --branch master https://github.com/aspose-barcode/Aspose.BarCode-Documentation.git || (cd Aspose.BarCode-Documentation && git checkout master && git pull)
git clone --single-branch --branch master https://git.dev.dynabic.com/containerize-hugo/lutsk-aspose-prototype.git || (cd lutsk-aspose-prototype && git pull)
cd lutsk-aspose-prototype
git clone --single-branch --branch master https://git.dev.dynabic.com/containerize-hugo/lutsk-aspose-theme.git themes/lutsk-aspose-theme || (cd themes/lutsk-aspose-theme && git pull)
sudo npm install -D --save autoprefixer
sudo npm install -D --save postcss-cli
rsync --recursive --delete --force --progress ${{ secrets.PROJECTPATH }} content/
rm -rf public
hugo --minify --baseURL https://docs.aspose.com/barcode
rsync --recursive --delete --force -e "ssh" --progress public/ ${{ secrets.TRANSFERPATH }}
- name: hugo deploy
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.SSHKEY }}
port: ${{ secrets.SSHPORT }}
script: |
sudo rsync --recursive --delete --force --progress ${{ secrets.PUBLICCONTENTPATH }} ${{ secrets.DEPLOYPATH }}
sudo nginx -s reload
job-two:
name: Deploy_to_qa
runs-on: [self-hosted, linux, x64, dev4-barcode]
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_KEY }}
if: github.ref == 'refs/heads/qa'
steps:
- name: hugo build and deploy
run: |
cd aspose-barcode-docs
git clone --branch qa https://github.com/aspose-barcode/Aspose.BarCode-Documentation.git || (cd Aspose.BarCode-Documentation && git checkout qa && git pull)
git clone --single-branch --branch master https://git.dev.dynabic.com/containerize-hugo/lutsk-aspose-prototype.git || (cd lutsk-aspose-prototype && git pull)
cd lutsk-aspose-prototype
git clone --single-branch --branch master https://git.dev.dynabic.com/containerize-hugo/lutsk-aspose-theme.git themes/lutsk-aspose-theme || (cd themes/lutsk-aspose-theme && git pull)
sudo npm install -D --save autoprefixer
sudo npm install -D --save postcss-cli
rsync --recursive --delete --force --progress ${{ secrets.PROJECTPATH }} content/
rm -rf public
hugo --minify --baseURL https://docs-qa.aspose.com/barcode
echo "Deploy to S3"
aws s3 sync ./public/ ${{ secrets.QA_S3_BUCKET }} --delete --only-show-errors
curl -d '{"website":"https://docs-qa.aspose.com/barcode/*"}' -H "Content-Type: application/json" -X POST "https://ut8o7juetc.execute-api.us-west-2.amazonaws.com/CloudFront-Invalidation-API"