-
Notifications
You must be signed in to change notification settings - Fork 14
103 lines (92 loc) · 3.1 KB
/
publish-to-prod-environment.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
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: publish-to-prod-environment
on:
workflow_dispatch:
inputs:
folder:
description: 'Content to publish'
required: true
default: 'Vantage (English)'
type: choice
options:
- Vantage (English)
- Vantage (ja, fr, es, de)
jobs:
sftp-files-to-cdn-and-purge-cache:
runs-on: prod-publish
container:
image: ubuntu:latest
steps:
- name: Install
run: |
apt update
apt install -y lftp httpie git
pip install httpie httpie-edgegrid --break-system-packages
- name: Checkout
uses: actions/checkout@v4
with:
sparse-checkout: Vantage
- name: FTPS Vantage (English)
if: ${{ inputs.folder == 'Vantage (English)' }}
run: |
lftp -e "
set ftp:ssl-protect-data no;
set ftp:ssl-protect-list no;
set ftp:ssl-protect-fxp no;
set ftp:ssl-force yes;
set ftp:ssl-auth TLS;
set ssl:verify-certificate no;
set ssl:check-hostname false;
open -u ${{ secrets.CDN_FTP_USERNAME }},${{ secrets.CDN_FTP_PASSWORD }} ${{ secrets.CDN_FTP_HOST }};
cd product-help/Vantage;
mput Vantage/*.md;
mput Vantage/*.json;
cd Images;
mput Vantage/Images/*;
bye
"
- name: FTPS Vantage translations (ja, fr, es, de)
if: ${{ inputs.folder == 'Vantage (ja, fr, es, de)' }}
run: |
lftp -e "
set ftp:ssl-protect-data no;
set ftp:ssl-protect-list no;
set ftp:ssl-protect-fxp no;
set ftp:ssl-force yes;
set ftp:ssl-auth TLS;
set ssl:verify-certificate no;
set ssl:check-hostname false;
open -u ${{ secrets.CDN_FTP_USERNAME }},${{ secrets.CDN_FTP_PASSWORD }} ${{ secrets.CDN_FTP_HOST }};
cd product-help/Vantage;
cd ja;
mput Vantage/ja/*.md;
mput Vantage/ja/*.json;
cd Images;
mput Vantage/ja/Images/*;
cd ../..;
cd fr;
mput Vantage/fr/*.md;
mput Vantage/fr/*.json;
cd Images;
mput Vantage/fr/Images/*;
cd ../..;
cd es;
mput Vantage/es/*.md;
mput Vantage/es/*.json;
cd Images;
mput Vantage/es/Images/*;
cd ../..;
cd de;
mput Vantage/de/*.md;
mput Vantage/de/*.json;
cd Images;
mput Vantage/de/Images/*;
bye
"
- name: purge cache
run: |
echo "[default]" > ~/.edgerc
echo "client_secret = ${{ secrets.CACHE_CLIENT_SECRET }}" >> ~/.edgerc
echo "host = ${{ secrets.CACHE_HOST }}" >> ~/.edgerc
echo "access_token = ${{ secrets.CACHE_ACCESS_TOKEN }}" >> ~/.edgerc
echo "client_token = ${{ secrets.CACHE_CLIENT_TOKEN }}" >> ~/.edgerc
http --ignore-stdin --auth-type=edgegrid -a default: :/ccu/v3/invalidate/cpcode/production objects:='[1051984]'