name: Deploy to Firebase Hosting on merge on: push: branches: - master jobs: build: if: ${{ github.repository_owner == 'developomp' }} name: Build runs-on: ubuntu-latest steps: - name: Checkout Repo uses: actions/checkout@master - name: Setup Node uses: actions/setup-node@v2 with: node-version: 16 cache: yarn cache-dependency-path: yarn.lock - name: Install dependencies and Build run: yarn install && yarn build - name: Archive Production Artifact uses: actions/upload-artifact@master with: name: build path: build deploy: if: ${{ github.repository_owner == 'developomp' }} name: Deploy needs: build runs-on: ubuntu-latest steps: - name: Checkout Repo uses: actions/checkout@master - name: Download Artifact uses: actions/download-artifact@master with: name: build path: build - name: Set target uses: w9jds/firebase-action@master with: args: use developomp-site env: GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }} - name: Apply target uses: w9jds/firebase-action@master with: args: target:apply hosting stable developomp-site env: GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }} - name: Deploy to Firebase uses: w9jds/firebase-action@master with: args: deploy --only hosting:stable env: GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }}