chore(deps): bump astro from 6.1.5 to 6.4.6 #1197
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: π³ Build and deploy | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - "apps/web/**" | |
| - "apps/uno/**" | |
| - "packages/**" | |
| - "pnpm-lock.yaml" | |
| - "turbo.json" | |
| - ".github/workflows/docker-publish.yaml" | |
| pull_request: | |
| branches: | |
| - main | |
| paths: | |
| - "apps/web/**" | |
| - "apps/uno/**" | |
| - "packages/**" | |
| - "pnpm-lock.yaml" | |
| - "turbo.json" | |
| - ".github/workflows/docker-publish.yaml" | |
| concurrency: | |
| group: docker-publish-${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || 'main' }} | |
| cancel-in-progress: true | |
| env: | |
| REGISTRY: ghcr.io | |
| jobs: | |
| create-pending-status: | |
| if: github.event_name == 'pull_request' && github.event.pull_request.user.type != 'Bot' | |
| name: π Set PR status to redeploying | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pull-requests: write | |
| steps: | |
| - name: π Update PR comment with redeploying status | |
| uses: actions/github-script@v8 | |
| with: | |
| script: | | |
| const marker = '<!-- preview-env -->'; | |
| const { data: comments } = await github.rest.issues.listComments({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: ${{ github.event.pull_request.number }}, | |
| }); | |
| const existing = comments.find((c) => c.body.includes(marker)); | |
| if (existing) { | |
| let body = existing.body; | |
| if (body.includes('| Status |')) { | |
| body = body.replace(/\| Status \|.*\|/, '| Status | π Redeploying... |'); | |
| } else { | |
| body = body.replace(/(\|.*\|.*\|\n)(\n)/, '$1| Status | π Redeploying... |\n$2'); | |
| } | |
| await github.rest.issues.updateComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| comment_id: existing.id, | |
| body, | |
| }); | |
| } | |
| build-and-push-uno: | |
| if: github.event_name == 'push' || github.event.pull_request.user.type != 'Bot' | |
| name: π³ Build uno | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| env: | |
| IMAGE_NAME: uno | |
| steps: | |
| - name: π Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: π Log in to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: π·οΈ Extract metadata for Docker | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }} | |
| tags: | | |
| type=raw,value=latest,enable={{is_default_branch}} | |
| type=ref,event=pr,prefix=pr- | |
| - name: ποΈ Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: π³ Build and push uno | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: ./apps/uno/Dockerfile | |
| target: web | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| platforms: linux/amd64 | |
| build-and-push-uno-cron: | |
| if: github.event_name == 'push' || github.event.pull_request.user.type != 'Bot' | |
| name: π³ Build uno cron | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| env: | |
| IMAGE_NAME: uno-cron | |
| steps: | |
| - name: π Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: π Log in to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: π·οΈ Extract metadata for Docker | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }} | |
| tags: | | |
| type=raw,value=latest,enable={{is_default_branch}} | |
| type=ref,event=pr,prefix=pr- | |
| - name: ποΈ Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: π³ Build and push uno cron | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: ./apps/uno/Dockerfile | |
| target: cron | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| build-args: GIT_COMMIT_SHA=${{ github.sha }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| platforms: linux/amd64 | |
| build-and-push-web: | |
| if: github.event_name == 'push' || github.event.pull_request.user.type != 'Bot' | |
| name: π³ Build web | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| env: | |
| IMAGE_NAME: web | |
| steps: | |
| - name: π Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: π Log in to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: π·οΈ Extract metadata for Docker | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }} | |
| tags: | | |
| type=raw,value=latest,enable={{is_default_branch}} | |
| type=ref,event=pr,prefix=pr- | |
| - name: π Set API URL | |
| id: api-url | |
| run: | | |
| if [ "${{ github.event_name }}" = "pull_request" ]; then | |
| echo "value=https://pr-${{ github.event.pull_request.number }}.uno.${{ secrets.PREVIEW_DOMAIN }}" >> $GITHUB_OUTPUT | |
| else | |
| echo "value=https://uno.echo-webkom.no" >> $GITHUB_OUTPUT | |
| fi | |
| - name: ποΈ Set Sanity dataset | |
| id: sanity-dataset | |
| run: | | |
| if [ "${{ github.event_name }}" = "pull_request" ]; then | |
| echo "value=develop" >> $GITHUB_OUTPUT | |
| else | |
| echo "value=production" >> $GITHUB_OUTPUT | |
| fi | |
| - name: ποΈ Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: π³ Build and push web | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: ./apps/web/Dockerfile | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| build-args: | | |
| GIT_COMMIT_SHA=${{ github.sha }} | |
| NEXT_PUBLIC_API_URL=${{ steps.api-url.outputs.value }} | |
| NEXT_PUBLIC_SANITY_DATASET=${{ steps.sanity-dataset.outputs.value }} | |
| NEXT_PUBLIC_UMAMI_URL=${{ secrets.NEXT_PUBLIC_UMAMI_URL }} | |
| NEXT_PUBLIC_UMAMI_WEBSITE_ID=${{ secrets.NEXT_PUBLIC_UMAMI_WEBSITE_ID }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| platforms: linux/amd64 | |
| # Migrator that only runs on PRs, since it is used to seed and migrate the preview environment, and is not needed for production deployments. | |
| build-and-push-migrator: | |
| if: github.event_name == 'pull_request' && github.event.pull_request.user.type != 'Bot' | |
| name: π³ Build migrator | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| env: | |
| IMAGE_NAME: migrator | |
| steps: | |
| - name: π Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: π Log in to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: π·οΈ Extract metadata for Docker | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }} | |
| tags: | | |
| type=ref,event=pr,prefix=pr- | |
| - name: ποΈ Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: π³ Build and push migrator | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: ./packages/seeder/Dockerfile | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| platforms: linux/amd64 | |
| deploy-preview: | |
| if: github.event_name == 'pull_request' && github.event.pull_request.user.type != 'Bot' | |
| needs: [build-and-push-uno, build-and-push-web, build-and-push-migrator] | |
| name: π Deploy PR Preview | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| steps: | |
| - name: π Checkout repository | |
| uses: actions/checkout@v6 | |
| with: | |
| sparse-checkout: preview | |
| - name: π Setup SSH | |
| uses: webfactory/ssh-agent@v0.9.0 | |
| with: | |
| ssh-private-key: ${{ secrets.VPS_SSH_KEY }} | |
| - name: π Add VPS to known hosts | |
| run: ssh-keyscan -H ${{ secrets.VPS_HOST }} >> ~/.ssh/known_hosts | |
| - name: π Log in to GitHub Container Registry on VPS | |
| env: | |
| DOCKER_HOST: ssh://deploy@${{ secrets.VPS_HOST }} | |
| run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | |
| - name: π Deploy preview stack | |
| env: | |
| DOCKER_HOST: ssh://deploy@${{ secrets.VPS_HOST }} | |
| PR_NUMBER: ${{ github.event.pull_request.number }} | |
| DB_PASSWORD: ${{ secrets.PREVIEW_DATABASE_PASSWORD }} | |
| ADMIN_KEY: ${{ secrets.PREVIEW_ADMIN_KEY }} | |
| AUTH_SECRET: ${{ secrets.AUTH_SECRET }} | |
| FEIDE_CLIENT_ID: ${{ secrets.FEIDE_CLIENT_ID }} | |
| FEIDE_CLIENT_SECRET: ${{ secrets.FEIDE_CLIENT_SECRET }} | |
| PREVIEW_DOMAIN: ${{ secrets.PREVIEW_DOMAIN }} | |
| GIT_COMMIT_SHA: ${{ github.sha }} | |
| MINIO_ROOT_USER: ${{ secrets.MINIO_ROOT_USER }} | |
| MINIO_ROOT_PASSWORD: ${{ secrets.MINIO_ROOT_PASSWORD }} | |
| run: docker compose -p pr-${PR_NUMBER} -f preview/docker-compose.yaml up -d --pull always --wait | |
| - name: π¬ Comment on PR | |
| uses: actions/github-script@v8 | |
| env: | |
| PREVIEW_DOMAIN: ${{ secrets.PREVIEW_DOMAIN }} | |
| PR_NUMBER: ${{ github.event.pull_request.number }} | |
| with: | |
| script: | | |
| const marker = '<!-- preview-env -->'; | |
| const domain = process.env.PREVIEW_DOMAIN; | |
| const prNumber = process.env.PR_NUMBER; | |
| const body = [ | |
| marker, | |
| '## Preview Environment', | |
| '', | |
| '| Project | URL |', | |
| '|---------|-----|', | |
| `| Frontend | <a href="https://pr-${prNumber}.web.${domain}" target="_blank">https://pr-${prNumber}.web.${domain}</a> |`, | |
| `| Backend | <a href="https://pr-${prNumber}.uno.${domain}" target="_blank">https://pr-${prNumber}.uno.${domain}</a> |`, | |
| `| Status | π’ Deployed |`, | |
| '', | |
| `_Deployed from \`${context.sha.slice(0, 7)}\` at ${new Date().toLocaleString('nb-NO', { timeZone: 'Europe/Oslo' })}_`, | |
| ].join('\n'); | |
| const { data: comments } = await github.rest.issues.listComments({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: ${{ github.event.pull_request.number }}, | |
| }); | |
| const existing = comments.find((c) => c.body.includes(marker)); | |
| if (existing) { | |
| await github.rest.issues.updateComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| comment_id: existing.id, | |
| body, | |
| }); | |
| } else { | |
| await github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: ${{ github.event.pull_request.number }}, | |
| body, | |
| }); | |
| } | |
| auto-deploy-web-uno: | |
| name: π Auto deploy web | |
| if: github.event_name == 'push' && github.ref_name == 'main' | |
| needs: [build-and-push-web, build-and-push-uno] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: π Checkout | |
| uses: actions/checkout@v6 | |
| - name: π¦ Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| - name: π’ Setup node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 22.22.0 | |
| cache: pnpm | |
| cache-dependency-path: ./pnpm-lock.yaml | |
| - name: π¦ Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: ποΈ Migrate database | |
| run: pnpm db:migrate | |
| env: | |
| DATABASE_URL: ${{ secrets.DATABASE_URL }} | |
| - name: π Auto deploy web | |
| run: curl ${{ secrets.DEPLOY_WEB_URL }} | |
| - name: π Auto deploy uno | |
| run: curl ${{ secrets.DEPLOY_UNO_URL }} | |
| auto-deploy-cron: | |
| name: π Auto deploy cron | |
| if: github.event_name == 'push' && github.ref_name == 'main' | |
| needs: [build-and-push-uno-cron] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: π Auto deploy cron | |
| run: curl ${{ secrets.DEPLOY_CRON_URL }} |