Skip to content

publish-to-prod-environment #8

publish-to-prod-environment

publish-to-prod-environment #8

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: tc-egress-nonprod-f42aba-0
container:
image: ubuntu:latest
steps:
- name: Install
run: |
apt update
apt install -y lftp python3 python3-pip httpie
pip install httpie httpie-edgegrid
- 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: |
http --ignore-stdin --auth-type=edgegrid -a default: :/ccu/v3/invalidate/cpcode/production objects:='[1051984]'