diff --git a/.github/workflows/deploy_worker.yml b/.github/workflows/deploy.yml similarity index 53% rename from .github/workflows/deploy_worker.yml rename to .github/workflows/deploy.yml index 335bd37..2131ece 100644 --- a/.github/workflows/deploy_worker.yml +++ b/.github/workflows/deploy.yml @@ -3,6 +3,7 @@ on: push: pull_request: repository_dispatch: + workflow_dispatch: jobs: deploy: @@ -16,17 +17,24 @@ jobs: uses: actions/setup-node@v1 with: node-version: ${{ matrix.node-version }} - - name: Check if Flotiq API key is set - run: [ -z "$GATSBY_FLOTIQ_API_KEY" ] && echo "Flotiq API Key is not set, using a starter one." && GATSBY_FLOTIQ_API_KEY="40accb088d028cb0779d8fc2ea7646e4" || true + - name: Check if Flotiq API key is set. + env: + GATSBY_FLOTIQ_API_KEY: ${{ secrets.GATSBY_FLOTIQ_API_KEY }} + run: | + if [ -z "$GATSBY_FLOTIQ_API_KEY" ]; then + echo "Flotiq API Key is not set, using a starter one." && echo "GATSBY_FLOTIQ_API_KEY=40accb088d028cb0779d8fc2ea7646e4" >> $GITHUB_ENV + else + echo "Using user-provided Flotiq API Key." && echo "GATSBY_FLOTIQ_API_KEY=$GATSBY_FLOTIQ_API_KEY" >> $GITHUB_ENV + fi - run: npm install -g gatsby-cli - run: npm install -g flotiq-cli - - run: flotiq import . ${{ secrets.GATSBY_FLOTIQ_API_KEY }} + # - run: flotiq import . $GATSBY_FLOTIQ_API_KEY - run: yarn install - run: gatsby build - env: - GATSBY_FLOTIQ_API_KEY: ${{ secrets.GATSBY_FLOTIQ_API_KEY }} + # env: + # GATSBY_FLOTIQ_API_KEY: ${{ secrets.GATSBY_FLOTIQ_API_KEY }} - name: Build & Deploy Worker uses: cloudflare/wrangler-action@v3 with: apiToken: ${{ secrets.CF_API_TOKEN }} - accountId: ${{ secrets.CF_ACCOUNT_ID }} \ No newline at end of file + accountId: ${{ secrets.CF_ACCOUNT_ID }}