feat: update fetch-vercel-envs script to extract and replace environm… #362
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: CI Web App | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
permissions: | |
contents: read | |
packages: write | |
env: | |
DOCK_IMAGE_NAME: aident-ai/open-cuak-web | |
jobs: | |
prettier: | |
name: Prettier Check | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
- name: Run Prettier | |
id: prettier-run | |
uses: rutajdash/[email protected] | |
with: | |
config_path: ./.prettierrc | |
- name: Prettier Output | |
if: ${{ failure() }} | |
shell: bash | |
run: | | |
echo "The following files are not formatted:" | |
echo "${{steps.prettier-run.outputs.prettier_output}}" | |
on-pull-request: | |
name: Build Web App | |
runs-on: ubuntu-latest | |
if: github.event_name == 'pull_request' | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Build NextJS App | |
uses: ./.github/actions/build-web-app | |
on-push-amd64: | |
name: Deploy Web App (AMD64) | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Build NextJS App | |
uses: ./.github/actions/build-web-app | |
# Build and push Docker image for AMD64 | |
- name: Set short git commit SHA | |
id: commit | |
uses: prompt/actions-commit-hash@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push AMD64 Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: ./apps/web/Dockerfile | |
push: true | |
platforms: linux/amd64 | |
tags: | | |
ghcr.io/${{ env.DOCK_IMAGE_NAME }}:${{ steps.commit.outputs.short }}-amd64 | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
on-push-arm64: | |
name: Deploy Web App (ARM64) | |
runs-on: ubuntu-24.04-arm | |
if: github.event_name == 'push' | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Build NextJS App | |
uses: ./.github/actions/build-web-app | |
# Build and push Docker image for ARM64 | |
- name: Set short git commit SHA | |
id: commit | |
uses: prompt/actions-commit-hash@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push ARM64 Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: ./apps/web/Dockerfile | |
push: true | |
platforms: linux/arm64 | |
tags: | | |
ghcr.io/${{ env.DOCK_IMAGE_NAME }}:${{ steps.commit.outputs.short }}-arm64 | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
create-manifest: | |
name: Create Multi-Arch Manifest | |
runs-on: ubuntu-latest | |
needs: [on-push-amd64, on-push-arm64] | |
if: github.event_name == 'push' | |
steps: | |
- name: Set short git commit SHA | |
id: commit | |
uses: prompt/actions-commit-hash@v2 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Create and push manifest | |
run: | | |
docker buildx imagetools create -t ghcr.io/${{ env.DOCK_IMAGE_NAME }}:${{ steps.commit.outputs.short }} \ | |
ghcr.io/${{ env.DOCK_IMAGE_NAME }}:${{ steps.commit.outputs.short }}-amd64 \ | |
ghcr.io/${{ env.DOCK_IMAGE_NAME }}:${{ steps.commit.outputs.short }}-arm64 | |
docker buildx imagetools create -t ghcr.io/${{ env.DOCK_IMAGE_NAME }}:latest \ | |
ghcr.io/${{ env.DOCK_IMAGE_NAME }}:${{ steps.commit.outputs.short }}-amd64 \ | |
ghcr.io/${{ env.DOCK_IMAGE_NAME }}:${{ steps.commit.outputs.short }}-arm64 |