fix: enable ID links in ocotillo component #57
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: CD deploy pre-production to GAE | |
| on: | |
| push: | |
| branches: [ pre-production ] | |
| jobs: | |
| deploy-dev: | |
| runs-on: ubuntu-latest | |
| environment: pre-production | |
| steps: | |
| # checkout the repo | |
| - uses: actions/checkout@v4 | |
| #build ocotillo | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22.x | |
| cache: npm | |
| cache-dependency-path: package-lock.json | |
| - name: Install deps & build | |
| env: | |
| VITE_APP_TITLE: "NMBGMR Ocotillo" | |
| # VITE_NMBGMR_AMP_API_URL: ${{ secrets.VITE_NMBGMR_AMP_API_URL_DEV }} | |
| # VITE_NMBGMR_GEOTHERMAL_API_URL: ${{ secrets.VITE_NMBGMR_GEOTHERMAL_API_URL_DEV }} | |
| VITE_MAPBOX_TOKEN: ${{ secrets.VITE_MAPBOX_TOKEN_DEV }} | |
| # VITE_FIEF_BASE_URL: ${{ secrets.VITE_FIEF_BASE_URL_DEV }} | |
| # VITE_FIEF_CLIENT_ID: ${{ secrets.VITE_FIEF_CLIENT_ID_DEV }} | |
| VITE_BASE_URL: ${{ secrets.VITE_BASE_URL_DEV }} | |
| VITE_AUTHENTIK_CLIENT_ID: ${{ secrets.VITE_AUTHENTIK_CLIENT_ID }} | |
| VITE_AUTHENTIK_URL: ${{ secrets.VITE_AUTHENTIK_URL }} | |
| VITE_AUTHENTIK_REDIRECT_URI: ${{ secrets.VITE_AUTHENTIK_REDIRECT_URI }} | |
| VITE_OCOTILLO_API_URL: ${{ secrets.VITE_OCOTILLO_API_URL }} | |
| run: | | |
| npm ci | |
| npm audit fix || true | |
| npm run build | |
| # authenticate to Google Cloud | |
| - uses: google-github-actions/auth@v2 | |
| with: | |
| credentials_json: ${{ secrets.GCP_SA_KEY_DEV }} | |
| # deploy to App Engine | |
| - id: deploy | |
| uses: google-github-actions/deploy-appengine@v2 | |
| with: | |
| project_id: ${{ secrets.GCP_PROJECT_ID_DEV }} | |
| deliverables: app.yaml | |
| promote: true | |
| # Clean up old versions - delete only the oldest version, one created and one destroyed | |
| - name: Clean up oldest version | |
| run: | | |
| OLDEST_VERSION=$(gcloud app versions list --service=ocotillo --project=${{ secrets.GCP_PROJECT_ID_DEV }} --format="value(id)" --sort-by="version.createTime" | head -n 1) | |
| if [ ! -z "$OLDEST_VERSION" ]; then | |
| echo "Deleting oldest version: $OLDEST_VERSION" | |
| gcloud app versions delete $OLDEST_VERSION --service=ocotillo --project=${{ secrets.GCP_PROJECT_ID_DEV }} --quiet | |
| echo "Deleted oldest version: $OLDEST_VERSION" | |
| else | |
| echo "No versions to delete" | |
| fi | |
| # Use PR author's username as git user name | |
| - name: Set up git user | |
| run: | | |
| git config --global user.name "${{ github.actor }}" | |
| git config --global user.email "${{ github.actor }}@users.noreply.github.com" | |
| - name: Tag commit | |
| run: | | |
| git tag -a "ocotillodev-deploy-$(date -u +%Y-%m-%d)T$(date -u +%H-%M-%S%z)" -m "ocotillodev deployment: $ | |
| (date -u +%Y-%m-%d)T$(date -u +%H:%M:%S%z)" | |
| git push origin --tags |