Merge pull request #368 from cioos-siooc/migrate-cioos-form #69
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: Deploy firebase functions | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- "firebase-functions/**" | |
workflow_dispatch: | |
jobs: | |
deploy: | |
name: Deploy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@master | |
- name: Install Dependencies | |
run: npm ci | |
working-directory: firebase-functions | |
- name: Install Firebase CLI | |
run: npm install -g firebase-tools | |
- name: Install Dependencies | |
run: npm ci | |
working-directory: firebase-functions/functions | |
- name: Authenticate Firebase and Deploy | |
run: | | |
echo "Creating .env file..." | |
echo "GMAIL_USER=${{ secrets.GMAIL_USER }}" >> .env | |
echo "GMAIL_PASS=${{ secrets.GMAIL_PASS }}" >> .env | |
echo "DATACITE_AUTH_HASH=${{ secrets.DATACITE_AUTH_HASH }}" >> .env | |
echo "AWS_REGION=${{ secrets.AWS_REGION }}" >> .env | |
echo "AWS_ACCESSKEYID=${{ secrets.AWS_ACCESSKEYID }}" >> .env | |
echo "AWS_SECRETACCESSKEY=${{ secrets.AWS_SECRETACCESSKEY }}" >> .env | |
echo "GITHUB_AUTH=${{ secrets.ISSUE_CREATOR_PAT }}" >> .env | |
echo "REACT_APP_GOOGLE_CLOUD_API_KEY=${{ secrets.REACT_APP_GOOGLE_CLOUD_API_KEY }}" >> .env | |
echo "REACT_APP_GOOGLE_CLOUD_API_KEY_DEV=${{ secrets.REACT_APP_GOOGLE_CLOUD_API_KEY_DEV }}" >> .env | |
echo "Setting Firebase Project..." | |
firebase use default | |
echo "Deploying to Firebase..." | |
firebase deploy --only functions --token ${{ secrets.FIREBASE_TOKEN }} | |
working-directory: firebase-functions/functions | |
env: | |
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} | |
GMAIL_USER: ${{ secrets.GMAIL_USER }} | |
GMAIL_PASS: ${{ secrets.GMAIL_PASS }} | |
DATACITE_AUTH_HASH: ${{ secrets.DATACITE_AUTH_HASH }} | |
AWS_REGION: ${{ secrets.AWS_REGION }} | |
AWS_ACCESSKEYID: ${{ secrets.AWS_ACCESSKEYID }} | |
AWS_SECRETACCESSKEY: ${{ secrets.AWS_SECRETACCESSKEY }} | |
GITHUB_AUTH: ${{ secrets.ISSUE_CREATOR_PAT }} | |
REACT_APP_GOOGLE_CLOUD_API_KEY: ${{ secrets.REACT_APP_GOOGLE_CLOUD_API_KEY }} | |
REACT_APP_GOOGLE_CLOUD_API_KEY_DEV: ${{ secrets.REACT_APP_GOOGLE_CLOUD_API_KEY_DEV }} | |
PROJECT_PATH: ./firebase-functions |