fix: frontend dev CORS proxy and default testnet network (#55) #12
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: Frontend Image | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| app_config: | |
| description: "Frontend config to build with" | |
| required: true | |
| default: "gravity" | |
| push: | |
| branches: [main] | |
| paths: | |
| - "frontend/**" | |
| - ".github/workflows/frontend-image.yml" | |
| permissions: | |
| contents: read | |
| packages: write | |
| jobs: | |
| build-and-push: | |
| name: Build and push frontend image | |
| runs-on: ubuntu-latest | |
| env: | |
| APP_CONFIG: ${{ github.event.inputs.app_config || 'gravity' }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set image name and short SHA | |
| run: | | |
| echo "IMAGE_NAME=ghcr.io/${GITHUB_REPOSITORY,,}/frontend" >> "$GITHUB_ENV" | |
| echo "SHORT_SHA=${GITHUB_SHA::7}" >> "$GITHUB_ENV" | |
| - name: Build and push | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: frontend | |
| file: frontend/Dockerfile | |
| push: true | |
| build-args: | | |
| APP_CONFIG=${{ env.APP_CONFIG }} | |
| tags: | | |
| ${{ env.IMAGE_NAME }}:latest | |
| ${{ env.IMAGE_NAME }}:sha-${{ env.SHORT_SHA }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max |