fixing default log layer #61
Workflow file for this run
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: CICD Server | |
| on: | |
| push: | |
| branches: | |
| - v0.29 | |
| tags: | |
| - 'v0.29.*' | |
| jobs: | |
| format_server: | |
| name: Format server | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: server | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Check formatting | |
| run: cargo fmt --check | |
| clippy_server: | |
| name: Clippy server | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: server | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Add clippy | |
| run: rustup component add clippy | |
| - name: Run clippy | |
| run: cargo clippy --all-targets -- -D warnings | |
| deploy: | |
| name: Deploy Playground Server | |
| runs-on: ubuntu-latest | |
| needs: | |
| - format_server | |
| - clippy_server | |
| if: startsWith(github.ref, 'refs/tags/') | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: v0.29 | |
| fetch-depth: 0 | |
| - name: Set up Git to get tag and normalize for App Engine | |
| run: | | |
| TAG="${GITHUB_REF#refs/tags/}" | |
| echo "Raw tag: $TAG" | |
| NORMALIZED_TAG="${TAG//./-}" | |
| echo "Normalized tag: $NORMALIZED_TAG" | |
| echo "VERSION_TAG=$NORMALIZED_TAG" >> $GITHUB_ENV | |
| - name: Set up Cloud SDK authentication | |
| uses: google-github-actions/auth@v2 | |
| with: | |
| token_format: 'access_token' | |
| credentials_json: ${{ secrets.GCP_KEY }} | |
| - name: Set up Cloud SDK | |
| uses: google-github-actions/setup-gcloud@v2 | |
| - name: Configure GCloud | |
| run: |- | |
| gcloud config set account ${{ secrets.SERVICE_ACCOUNT }} | |
| gcloud config set project ${{ secrets.PROJECT_ID }} | |
| - name: Authenticate Docker to Artifact Registry | |
| run: gcloud auth configure-docker us-central1-docker.pkg.dev | |
| - name: Build Docker image | |
| run: | | |
| docker build -t us-central1-docker.pkg.dev/${{ secrets.PROJECT_ID }}/solpgbuilds/solpg-server:${{ env.VERSION_TAG }} server/ | |
| - name: Push Docker image | |
| run: | | |
| docker push us-central1-docker.pkg.dev/${{ secrets.PROJECT_ID }}/solpgbuilds/solpg-server:${{ env.VERSION_TAG }} | |
| - name: Replace app.yaml environment variables | |
| uses: 73h/[email protected] | |
| env: | |
| VERSION_TAG: ${{ env.VERSION_TAG }} | |
| PG_DB_URI: ${{ secrets.PG_DB_URI }} | |
| PROJECT_ID: ${{ secrets.PROJECT_ID }} | |
| with: | |
| app_yaml_path: server/app.yaml | |
| - name: Deploy to App Engine with specific version (no promote) | |
| run: | | |
| gcloud app deploy app.yaml \ | |
| --image-url us-central1-docker.pkg.dev/${{ secrets.PROJECT_ID }}/solpgbuilds/solpg-server:${{ env.VERSION_TAG }} \ | |
| --project ${{ secrets.PROJECT_ID }} \ | |
| --version=${{ env.VERSION_TAG }} \ | |
| --no-promote | |
| working-directory: server |