Try setting the branch #18
This file contains 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: "Deploy" | |
on: | |
push: | |
branches: | |
- cloudflare-client | |
# This will make sure that only one deployment is running at a time | |
concurrency: | |
group: deployment | |
cancel-in-progress: true | |
env: | |
WASP_VERSION: "0.14.0" | |
# Put your server app name here | |
SERVER_APP_NAME: "render-ghcr-server" | |
# After you know the server URL, put the URL here | |
SERVER_APP_URL: "https://render-ghcr-server-main.onrender.com" | |
DOCKER_REGISTRY: "ghcr.io" | |
DOCKER_REGISTRY_USERNAME: ${{ github.repository_owner }} | |
# This secret is provided by GitHub by default and is used to authenticate with the Container registry | |
DOCKER_REGISTRY_PASSWORD: ${{ secrets.GITHUB_TOKEN }} | |
# Put your client Cloudflare app name here - make sure to create the app in Cloudflare Pages | |
# npx wrangler pages project create render-ghcr-client | |
CLIENT_CLOUDFLARE_APP_NAME: "render-ghcr-client" | |
WASP_TELEMETRY_DISABLED: 1 | |
jobs: | |
build-and-push-images: | |
permissions: | |
contents: read | |
packages: write | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Log in to the Container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ env.DOCKER_REGISTRY_USERNAME }} | |
password: ${{ env.DOCKER_REGISTRY_PASSWORD }} | |
- name: (server) Extract metadata for Docker | |
id: meta-server | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_REGISTRY_USERNAME }}/${{ env.SERVER_APP_NAME }} | |
- name: Install Wasp | |
shell: bash | |
run: curl -sSL https://get.wasp-lang.dev/installer.sh | sh -s -- -v ${{ env.WASP_VERSION }} | |
- name: Build Wasp app | |
shell: bash | |
run: wasp build | |
- name: (client) Build | |
shell: bash | |
run: | | |
cd ./.wasp/build/web-app | |
REACT_APP_API_URL=${{ env.SERVER_APP_URL }} npm run build | |
- name: (server) Build and push Docker image | |
uses: docker/build-push-action@v6 | |
with: | |
context: ./.wasp/build | |
file: ./.wasp/build/Dockerfile | |
push: true | |
tags: ${{ steps.meta-server.outputs.tags }} | |
labels: ${{ steps.meta-server.outputs.labels }} | |
# You can get the webhook URL from the Render dashboard | |
# Put them in the repository secrets under RENDER_SERVER_WEBHOOK_URL | |
- name: (server) Trigger Deploy Webhooks | |
env: | |
SERVER_URL: ${{ secrets.RENDER_SERVER_WEBHOOK_URL }} | |
run: | | |
curl "${{ env.SERVER_URL }}" | |
- name: (client) Deploy to Cloudflare Pages | |
uses: cloudflare/wrangler-action@v3 | |
with: | |
# Make sure to add CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID secrets | |
# You can get the API token from the Cloudflare dashboard | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
command: pages deploy ./.wasp/build/web-app/build --project-name=${{ env.CLIENT_CLOUDFLARE_APP_NAME }} --commit-dirty=true --branch=main |