Merge pull request #64 from Tamandutech/fix/busca_e_atualizacao_de_se… #29
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 Dashboard | |
on: | |
push: | |
branches: | |
- master | |
- develop | |
jobs: | |
setup: | |
name: Setup environment | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check branch | |
id: branch_check | |
run: | | |
echo "Running on branch ${{ github.ref }}" | |
if [ "${{ github.ref_name }}" = "master" ]; then | |
echo "::set-output name=env_name::PROD" | |
elif [ "${{ github.ref_name }}" = "develop" ]; then | |
echo "::set-output name=env_name::STAGE" | |
fi | |
outputs: | |
env_name: ${{ steps.branch_check.outputs.env_name }} | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
needs: [setup] | |
environment: ${{ needs.setup.outputs.env_name }} | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@master | |
- name: Install Dependencies | |
run: npm ci | |
- name: Build Dashboard | |
env: | |
API_KEY: ${{ secrets.API_KEY }} | |
AUTH_DOMAIN: ${{ secrets.AUTH_DOMAIN }} | |
DATA_BASE_URL: ${{ secrets.DATA_BASE_URL }} | |
PROJECT_ID: ${{ secrets.PROJECT_ID }} | |
STORAGE_BUCKET: ${{ secrets.STORAGE_BUCKET }} | |
MESSAGING_SENDER_ID: ${{ secrets.MESSAGING_SENDER_ID }} | |
APP_ID: ${{ secrets.APP_ID }} | |
GH_CLIENT_SECRET: ${{ secrets.GH_CLIENT_SECRET }} | |
GH_CLIENT_ID: ${{ secrets.GH_CLIENT_ID }} | |
OAUTH_REDIRECT_URI: ${{ secrets.OAUTH_REDIRECT_URI }} | |
run: npx quasar build -m pwa | |
- name: Archive Production Artifact | |
uses: actions/upload-artifact@master | |
with: | |
name: dist | |
path: dist | |
deploy: | |
name: 'Deploy em ${{ needs.setup.outputs.env_name }}' | |
needs: [setup, build] | |
runs-on: ubuntu-latest | |
environment: ${{ needs.setup.outputs.env_name }} | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@master | |
- name: Download Artifact | |
uses: actions/download-artifact@master | |
with: | |
name: dist | |
path: dist | |
# - name: Deploy to Firebase | |
# uses: w9jds/firebase-action@master | |
# with: | |
# args: deploy | |
# env: | |
# GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }} | |
# PROJECT_ID: ${{ secrets.PROJECT_ID}} | |
- name: Deploy to Firebase | |
uses: FirebaseExtended/action-hosting-deploy@v0 | |
with: | |
repoToken: "${{ secrets.GITHUB_TOKEN }}" | |
firebaseServiceAccount: "${{ secrets.GCP_SA_KEY }}" | |
projectId: ${{ secrets.PROJECT_ID }} | |
channelId: live |