publish-to-prod-environment #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
sparse-checkout: Vantage | |
- name: FTPS Vantage (English) | |
if: ${{ inputs.folder == 'Vantage (English)' }} | |
run: | | |
lftp -e " | |
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 " | |
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: | | |
/home/tdadmin/.local/bin/http --ignore-stdin --auth-type=edgegrid -a default: :/ccu/v3/invalidate/cpcode/production objects:='[1051984]' |