Skip to content

Deploy magazine to PRE and PRO #36

Deploy magazine to PRE and PRO

Deploy magazine to PRE and PRO #36

Workflow file for this run

name: Deploy magazine to PRE and PRO
on:
workflow_dispatch:
env:
SITE_PUBLIC_PATH: ./public
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Setup Node.js environment
uses: actions/setup-node@v3.8.1
- uses: actions/checkout@v2
- name: Run NPM INSTALL
run: npm install --force
- name: Node memory
run: export NODE_OPTIONS=--max_old_space_size=4096
- name: Run Gatsby
run: export NODE_OPTIONS='--max-old-space-size=8192' && npm run build
- name: Publish artifacts
uses: actions/upload-artifact@v2.2.2
with:
name: site
path: ${{ env.SITE_PUBLIC_PATH }}
deploypre:
runs-on: ubuntu-latest
needs: build
environment:
name: pre
steps:
- name: Download build artifact
uses: actions/download-artifact@v2.0.8
with:
name: site
path: ${{ env.SITE_PUBLIC_PATH }}
- name: Delete dev site
uses: Azure/cli@1.0.4
with:
inlineScript: az storage blob delete-batch -s '$web' --account-name ${{ secrets.ACCOUNT_NAME }} --account-key ${{ secrets.ACCOUNT_KEY }}
- name: Publish new version at dev
uses: Azure/cli@1.0.4
with:
inlineScript: az storage blob upload-batch -d '$web' -s ${{ env.SITE_PUBLIC_PATH }} --account-name ${{ secrets.ACCOUNT_NAME }} --account-key ${{ secrets.ACCOUNT_KEY }}
deploypro:
runs-on: ubuntu-latest
needs: deploypre
environment:
name: pro
steps:
- name: Download build artifact
uses: actions/download-artifact@v2.0.8
with:
name: site
path: ${{ env.SITE_PUBLIC_PATH }}
- name: Delete pro site
uses: Azure/cli@1.0.4
with:
inlineScript: az storage blob delete-batch -s '$web' --account-name ${{ secrets.ACCOUNT_NAME }} --account-key ${{ secrets.ACCOUNT_KEY }}
- name: Publish new version at pro
uses: Azure/cli@1.0.4
with:
inlineScript: az storage blob upload-batch -d '$web' -s ${{ env.SITE_PUBLIC_PATH }} --account-name ${{ secrets.ACCOUNT_NAME }} --account-key ${{ secrets.ACCOUNT_KEY }}