Merge pull request #172 from data-to-insight/build/cross-repo-deploy #10
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: Build and Deploy | |
on: | |
push: | |
branches: | |
- 'dev' | |
jobs: | |
build-and-deploy: | |
name: 'Build and Deploy Dev' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout 🛎️ | |
uses: actions/checkout@v3 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
cache: 'yarn' | |
- name: Install and Build 🔧 | |
env: | |
REACT_APP_SENTRY_DSN: ${{ secrets.SENTRY_DSN }} | |
REACT_APP_GA_MEASUREMENT_ID: ${{ secrets.GA_MEASUREMENT_ID }} | |
PUBLIC_URL: ${{ secrets.PUBLIC_URL }} | |
run: | | |
yarn install --frozen-lockfile | |
yarn build:dev | |
- name: Deploy 🚀 | |
if: github.ref == 'refs/heads/dev' | |
uses: JamesIves/[email protected] | |
with: | |
branch: gh-pages # The branch the action should deploy to. | |
folder: build # The folder the action should deploy. | |
target-folder: dev | |
- name: Pushes files to 903/LAC repo | |
uses: dmnemec/copy_file_to_another_repo_action@main | |
env: | |
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }} | |
with: | |
source_file: 'build/.' | |
destination_repo: 'data-to-insight/csc-validator-fe-publish-903' | |
destination_branch: 'gh-pages' | |
user_email: '[email protected]' | |
user_name: 'dotloadmovie' | |
commit_message: 'Release to 903' |