feat(openapi): stabilize generated OpenAPI contract for GraphQL Mesh … #143
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: | |
| - dev | |
| tags: | |
| - "*" | |
| env: | |
| IMAGE_NAME: ghcr.io/anitrend/on-the-edge | |
| CACHE_REF: ghcr.io/anitrend/on-the-edge:cache | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: ${{ github.event.inputs.environment || 'production' }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - 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() | |
| 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 |