Add public Cloudinary placeholder #445
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: PushToMainAction | |
| on: | |
| push: | |
| branches: ["main"] | |
| workflow_dispatch: | |
| # Cancel in-progress jobs or runs for the current workflow | |
| concurrency: | |
| group: deploy-main | |
| cancel-in-progress: true | |
| env: | |
| NODE_VERSION: "22.15.0" | |
| permissions: | |
| id-token: write | |
| contents: read | |
| jobs: | |
| build: | |
| runs-on: self-hosted | |
| steps: | |
| - name: Fetch git repository | |
| uses: actions/checkout@v6.0.2 | |
| with: | |
| fetch-depth: "0" | |
| - uses: actions/cache/restore@v5 | |
| id: cache | |
| with: | |
| path: | | |
| cache | |
| .sst | |
| key: cache-main | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: "npm" | |
| - name: Configure AWS credentials | |
| uses: aws-actions/configure-aws-credentials@v6 | |
| with: | |
| role-to-assume: arn:aws:iam::691071635361:role/github-actions-oidc-role | |
| aws-region: us-east-1 | |
| - name: security.txt | |
| run: | | |
| cd "$GITHUB_WORKSPACE" | |
| /srv/github-action-scripts/sign-security.sh | |
| if [ -f "security.txt.asc" ]; then | |
| mkdir "public/.well-known" | |
| mv security.txt.asc "public/.well-known/security.txt" | |
| else | |
| echo "No security.txt.asc produced" | |
| fi | |
| - name: Build and deploy | |
| run: | | |
| # Set up the environment variables | |
| export NODE_OPTIONS=--experimental-wasm-modules | |
| export IS_PUBLIC=true | |
| export CLOUDINARY_CLOUD_NAME=${{ secrets.CLOUDINARY_CLOUD_NAME }} | |
| export CLOUDINARY_API_KEY=${{ secrets.CLOUDINARY_API_KEY }} | |
| export CLOUDINARY_API_SECRET=${{ secrets.CLOUDINARY_API_SECRET }} | |
| export CLOUDINARY_URL=${{ secrets.CLOUDINARY_URL }} | |
| export DECAP_DOMAIN=${{ vars.DECAP_DOMAIN }} | |
| export PUBLIC_CLOUDINARY_CLOUD_NAME=${{ secrets.PUBLIC_CLOUDINARY_CLOUD_NAME }} | |
| export PUBLIC_FRIENDLY_CAPTCHA_SITEKEY=${{ vars.FRIENDLY_CAPTCHA_SITEKEY }} | |
| export FRIENDLY_CAPTCHA_API_KEY=${{ secrets.FRIENDLY_CAPTCHA_API_KEY }} | |
| export CUSTOM_DOMAIN=${{ vars.MAIN_CUSTOM_DOMAIN }} | |
| export GA_ID=${{ vars.MAIN_GA_ID }} | |
| export PIPELINE_CRM_API_KEY=${{ secrets.PIPELINE_CRM_API_KEY }} | |
| export PIPELINE_CRM_APP_KEY=${{ secrets.PIPELINE_CRM_APP_KEY }} | |
| export PIPELINE_CRM_ENDPOINT=${{ vars.PIPELINE_CRM_ENDPOINT }} | |
| export PIPELINE_CRM_W2LID=${{ vars.PIPELINE_CRM_W2LID }} | |
| # Set up npm | |
| node -v | |
| npm ci | |
| # Build & deploy | |
| if [ -d "dist" ]; then | |
| rm -rf dist | |
| fi | |
| npx sst deploy --stage prod --verbose | |
| - uses: actions/cache/save@v5 | |
| with: | |
| path: | | |
| cache | |
| .sst | |
| key: cache-main |