chore(deps): update dependency @graphql-hive/gateway to v2.14.0 #301
This file contains hidden or 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: Deploy | |
| on: | |
| workflow_call: | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: "Tag to build against" | |
| required: true | |
| default: "latest" | |
| environment: | |
| description: "Deployment environment" | |
| required: true | |
| default: "production" | |
| type: choice | |
| options: | |
| - production | |
| - staging | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - "*" | |
| env: | |
| IMAGE_NAME: ghcr.io/anitrend/edge-graphql | |
| CACHE_REF: ghcr.io/anitrend/edge-graphql:cache | |
| permissions: | |
| contents: read | |
| jobs: | |
| deploy: | |
| name: Deploy Edge GraphQL | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| environment: | |
| name: ${{ github.event.inputs.environment || 'production' }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v7 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v4 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set tag | |
| id: set-tag | |
| run: | | |
| if [[ -n "${{ github.event.inputs.tag }}" ]]; then | |
| tag=${{ github.event.inputs.tag }} | |
| elif [[ "${{ github.ref }}" =~ ^refs/tags/ ]]; then | |
| tag=${GITHUB_REF#refs/tags/} | |
| else | |
| tag=latest | |
| fi | |
| echo "Tag: $tag" | |
| echo "tag=$tag" >> "$GITHUB_OUTPUT" | |
| - name: Build and push snapshot image | |
| uses: docker/build-push-action@v7 | |
| with: | |
| context: . | |
| push: true | |
| platforms: linux/amd64,linux/arm64 | |
| cache-from: type=registry,ref=${{ env.CACHE_REF }} | |
| cache-to: type=registry,ref=${{ env.CACHE_REF }},mode=max | |
| tags: ${{ env.IMAGE_NAME }}:${{ steps.set-tag.outputs.tag }} | |
| notify: | |
| name: Notify Deployment | |
| runs-on: ubuntu-latest | |
| needs: deploy | |
| if: always() | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Notify success | |
| if: needs.deploy.result == 'success' | |
| run: | | |
| echo "Deployed successfully!" | |
| echo "Environment: ${{ github.event.inputs.environment || 'production' }}" | |
| echo "Commit: ${{ github.sha }}" | |
| echo "Timestamp: $(date -u)" | |
| - name: Notify failure | |
| if: needs.deploy.result == 'failure' | |
| run: | | |
| echo "Deployment failed!" | |
| echo "Please check the deployment logs and try again." | |
| exit 1 | |
| trigger-schema-sync: | |
| name: Trigger AniTrend GraphQL Schema Sync | |
| runs-on: ubuntu-latest | |
| needs: deploy | |
| if: needs.deploy.result == 'success' && startsWith(github.ref, 'refs/tags/') | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Create GitHub app token | |
| uses: actions/create-github-app-token@v3 | |
| id: app-token | |
| with: | |
| client-id: ${{ secrets.APP_ID }} | |
| private-key: ${{ secrets.APP_PRIVATE_KEY }} | |
| owner: anitrend | |
| repositories: edge-graphql,anitrend-v2 | |
| - name: Repository dispatch to AniTrend | |
| uses: peter-evans/repository-dispatch@v4 | |
| with: | |
| token: ${{ steps.app-token.outputs.token }} | |
| repository: AniTrend/anitrend-v2 | |
| event-type: graphql-schema-sync | |
| client-payload: '{"target":"anitrend"}' |