Skip to content

Deploy_To_Azure_Blobs_Dev #1276

Deploy_To_Azure_Blobs_Dev

Deploy_To_Azure_Blobs_Dev #1276

Workflow file for this run

name: Deploy_To_Azure_Blobs_Dev
on:
push:
paths-ignore: # https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet
- '**/README.md' # don't run on README.md file updates anywhere in repo
- '**/dependabot.yml'
branches:
- develop
schedule:
- cron: '24 04 * * *' # 0424am daily
env:
STORAGE_ACCOUNT_NAME: sadatastoresearchdev
STORAGE_ACCOUNT_KEY: ${{ secrets.DEV_STORAGE_KEY }}
jobs:
should_run:
uses: IATI/.github/.github/workflows/should_run.yaml@main
deploy:
needs: should_run
if: ${{ needs.should_run.outputs.should_run == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4.1.0
with:
node-version-file: '.nvmrc'
cache: 'npm'
- name: Install dependencies
run: |
npm install
- name: Copy dev environment variables to production file
run: |
rm ./envs/.env.production
cp ./envs/.env.development ./envs/.env.production
- name: Run build
run: |
npm run build:production
- name: Create robots.txt
run: |
echo -e 'User-agent: *\nDisallow: /\n' > dist/robots.txt
- name: Upload to blob storage
uses: azure/CLI@v1
with:
azcliversion: 2.34.0
inlineScript: |
az storage blob upload-batch \
--overwrite true \
--account-name ${{ env.STORAGE_ACCOUNT_NAME }} \
--account-key ${{ env.STORAGE_ACCOUNT_KEY }} \
-d '$web' \
-s dist/
integration-test:
needs: deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4.1.0
with:
node-version-file: '.nvmrc'
cache: 'npm'
- name: Cypress CI Run
uses: cypress-io/github-action@v6
with:
wait-on: 'https://dev-datastore.iatistandard.org'
config-file: cypress.config.dev.js
status_check_success:
needs: [deploy, integration-test]
if: success() && github.event_name == 'schedule'
uses: IATI/.github/.github/workflows/status_check_success.yaml@main
status_check_failure:
needs: [deploy, integration-test]
if: failure() && github.event_name == 'schedule'
uses: IATI/.github/.github/workflows/status_check_failure.yaml@main