Rename dashboard management routes (#3361) #254
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: Build and upload images | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| id-token: write | |
| jobs: | |
| build-images: | |
| name: Build and upload images to the ${{ matrix.environment }} environment | |
| runs-on: ci-builder | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| environment: | |
| - staging | |
| - foxtrot | |
| - juliett | |
| - tango | |
| environment: ${{ matrix.environment }} | |
| concurrency: | |
| group: build-images-${{ matrix.environment }} | |
| cancel-in-progress: false | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| with: | |
| ref: ${{ github.sha }} | |
| persist-credentials: false | |
| - name: Pull deployment secrets into temporary file | |
| uses: Infisical/secrets-action@v1.0.16 | |
| with: | |
| method: "oidc" | |
| identity-id: ${{ vars.INFISICAL_MACHINE_IDENTITY_ID }} | |
| project-slug: "infra-deployment" | |
| env-slug: ${{ matrix.environment }} | |
| export-type: "file" | |
| file-output-path: "/.env.infisical" | |
| - name: Load deployment environment | |
| env: | |
| ENVIRONMENT: ${{ matrix.environment }} | |
| run: | | |
| echo "${ENVIRONMENT}" > .last_used_env | |
| cat .env.infisical | sed "s/='\(.*\)'$/=\1/g" > ".env.${ENVIRONMENT}" | |
| set -a | |
| . ".env.${ENVIRONMENT}" | |
| set +a | |
| echo "GCP_REGION=${GCP_REGION}" >> "$GITHUB_ENV" | |
| echo "GCP_PROJECT_ID=${GCP_PROJECT_ID}" >> "$GITHUB_ENV" | |
| echo "GH_WORKLOAD_IDENTITY_PROVIDER=${GH_WORKLOAD_IDENTITY_PROVIDER}" >> "$GITHUB_ENV" | |
| - name: Load runtime environment | |
| uses: Infisical/secrets-action@v1.0.16 | |
| with: | |
| method: "oidc" | |
| identity-id: ${{ vars.INFISICAL_MACHINE_IDENTITY_ID }} | |
| project-slug: "infra-deployment-env" | |
| env-slug: ${{ matrix.environment }} | |
| export-type: "env" | |
| - name: Setup Service Account | |
| uses: google-github-actions/auth@v3 | |
| with: | |
| project_id: ${{ env.GCP_PROJECT_ID }} | |
| workload_identity_provider: ${{ env.GH_WORKLOAD_IDENTITY_PROVIDER }} | |
| - name: Set up Cloud SDK | |
| uses: google-github-actions/setup-gcloud@v3 | |
| - name: Set up Docker | |
| env: | |
| GCP_REGION: ${{ env.GCP_REGION }} | |
| run: | | |
| gcloud auth configure-docker "${GCP_REGION}-docker.pkg.dev" --quiet | |
| ACCESS_TOKEN="$(gcloud auth print-access-token)" | |
| DOCKER_AUTH_BASE64="$(echo -n "{\"username\":\"oauth2accesstoken\",\"password\":\"$ACCESS_TOKEN\"}" | base64 -w 0)" | |
| echo "::add-mask::$DOCKER_AUTH_BASE64" | |
| echo "DOCKER_AUTH_BASE64=${DOCKER_AUTH_BASE64}" >> "$GITHUB_ENV" | |
| - name: Build and upload images | |
| env: | |
| AUTO_CONFIRM_DEPLOY: true | |
| ENVD_UPLOAD_MODE: versioned | |
| run: make build-and-upload | |
| - name: Promote envd in staging | |
| if: ${{ matrix.environment == 'staging' }} | |
| env: | |
| ENVD_COMMIT_SHA: ${{ github.sha }} | |
| run: make -C packages/envd promote |