Skip to content

Merge pull request #318 from lgmorand/staging #136

Merge pull request #318 from lgmorand/staging

Merge pull request #318 from lgmorand/staging #136

name: Build and deploy on prod
on:
workflow_dispatch:
push:
branches:
- master
paths-ignore:
- '.github/scripts/**'
- 'markdown/**'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
# - name: Cache node modules
# uses: actions/cache@v2
# with:
# path: '**/node_modules'
# key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
- run: npm install
- run: gulp build
- name: Get current time
uses: josStorer/[email protected]
id: current-time
with:
format: DD-MM-YYYY
- uses: cschleiden/[email protected]
name: inject date
with:
files: '["**/*.html"]'
env:
BUILD_DATE: "${{ steps.current-time.outputs.formattedTime }}"
- name: Run the Transformer
run: |
pushd ./data/scripts
pip3 install pandas
python ./transform_to_ft.py
popd
- name: include FTA version
run: |
mkdir dist/fta
cp ./data/scripts/aks_checklist.en.json ./dist/fta/aks_checklist.en.json
- uses: actions/upload-artifact@v4
with:
name: CheckList
path: dist
- name: Azure Static Website Deploy
uses: feeloor/[email protected]
env:
# The name of the directory you want to upload
SOURCE_DIR: "./dist"
# Your Azure Client ID
AZURE_CLIENT_ID: "${{secrets.CLIENT_ID}}"
# Your Azure TENANT ID
AZURE_TENANT_ID: "${{secrets.AZ_TENANT}}"
# Your Azure Secret
AZURE_SECRET: "${{secrets.SECRET_ID}}"
# Your Azure Subscription ID
AZURE_SUBSCRIPTION_ID: "${{secrets.SUBSCRIPTION_ID}}"
# Your Azure Storage Account Name
AZURE_STORAGE_ACCOUNT_NAME: "stotheakschecklist"
# The index document that you specify when you enable static website hosting, appears when users open the site and dont specify a specific file.
AZURE_INDEX_DOCUMENT_NAME: "index.html"
FORCE_OVERWRITE: "true"
- name: AZ Login
run: az login --service-principal -u ${{ secrets.CLIENT_ID }} -p ${{ secrets.SECRET_ID }} -t ${{ secrets.AZ_TENANT }}
- name: Purge CDN
run:
az cdn endpoint purge -n ${{ secrets.AZURE_CDN_ENDPOINT }} --profile-name ${{ secrets.AZURE_CDN_PROFILE_NAME }} --content-paths "/*" --resource-group ${{ secrets.AZURE_RESOURCE_GROUP }} --no-wait
- name: Azure service principal logout
run: |
az logout