Merge pull request #6 from nitic-pbl-p8/4/auth #30
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: graphql deploy apollo studio | |
on: | |
push: | |
branches: | |
- main | |
env: | |
DATABASE_URL: postgresql://postgres:postgres@localhost:54322/postgres | |
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} | |
TURBO_TEAM: ${{ secrets.TURBO_TEAM }} | |
jobs: | |
filter: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
pull-requests: read | |
outputs: | |
graphql: ${{ steps.changes.outputs.graphql }} | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- name: check for file changes | |
uses: dorny/paths-filter@v2 | |
id: changes | |
with: | |
token: ${{ github.token }} | |
filters: .github/filter.yaml | |
deploy-apollo-studio: | |
runs-on: ubuntu-latest | |
env: | |
APOLLO_KEY: ${{ secrets.APOLLO_KEY }} | |
needs: filter | |
if: needs.filter.outputs.graphql == 'true' | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- name: setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version-file: "package.json" | |
- name: setup pnpm | |
uses: pnpm/action-setup@v2 | |
id: pnpm-install | |
with: | |
run_install: false | |
- name: setup pnpm environment variable | |
id: pnpm-env | |
run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | |
- name: cache pnpm dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.pnpm-env.outputs.STORE_PATH }} | |
key: ${{ runner.os }}-pnpm-dependencies-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: ${{ runner.os }}-pnpm-dependencies- | |
- name: install dependencies | |
run: pnpm install --frozen-lockfile | |
- name: generate graphql schema | |
run: timeout 15 pnpm api dev | |
continue-on-error: true | |
- name: publish graphs | |
run: pnpm api apollo:rover | |
graphql-deploy-apollo-check: | |
runs-on: ubuntu-latest | |
needs: deploy-apollo-studio | |
if: ${{ ! failure() }} | |
steps: | |
- name: check | |
run: echo "test is successfully executed." |