diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 77af054..ed7dd57 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -1,15 +1,33 @@ on: workflow_call: - inputs: - environment: - required: true - type: string - description: 'The environment to deploy to' jobs: - deploy: + staging: + if: github.ref == 'refs/heads/develop' runs-on: ubuntu-latest - environment: ${{ inputs.environment }} + environment: staging + steps: + - uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'yarn' + + - run: yarn install + - run: npx nx run website:build + - uses: FirebaseExtended/action-hosting-deploy@v0 + with: + repoToken: ${{ secrets.GITHUB_TOKEN }} + firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT }} + channelId: preview + projectId: ${{ secrets.FIREBASE_PROJECT_ID }} + + production: + if: github.ref == 'refs/heads/develop' + runs-on: ubuntu-latest + environment: staging steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8df74a2..698e462 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,18 +57,7 @@ jobs: .nx key: ${{ steps.nx-cache-restore.outputs.cache-primary-key }} - deploy-preview: - if: github.ref == 'refs/heads/develop' - needs: test - uses: ./.github/workflows/cd.yml - secrets: inherit - with: - environment: staging - deploy: - if: github.ref == 'refs/heads/master' needs: test uses: ./.github/workflows/cd.yml secrets: inherit - with: - environment: production