publish-to-prod-environment #20
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: 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]' |