2.11.156 #674
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: Production deployment | |
| on: | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| env: | |
| TAG: ${{ github.event.release.tag_name || github.sha }} | |
| STACK_FILE: docker/production.yml | |
| REPOSITORY: website | |
| REGISTRY_USERNAME: christyjacob4 | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout the repo | |
| uses: actions/checkout@v4 | |
| - name: Login to DockerHub | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| push: true | |
| tags: ghcr.io/appwrite/website:${{ env.TAG }} | |
| build-args: | | |
| "PUBLIC_APPWRITE_ENDPOINT=${{ vars.PUBLIC_APPWRITE_ENDPOINT }}" | |
| "PUBLIC_APPWRITE_DASHBOARD=${{ vars.PUBLIC_APPWRITE_DASHBOARD }}" | |
| "PUBLIC_APPWRITE_PROJECT_ID=${{ vars.PUBLIC_APPWRITE_PROJECT_ID }}" | |
| "PUBLIC_APPWRITE_DB_MAIN_ID=${{ vars.PUBLIC_APPWRITE_DB_MAIN_ID }}" | |
| "PUBLIC_APPWRITE_COL_THREADS_ID=${{ vars.PUBLIC_APPWRITE_COL_THREADS_ID }}" | |
| "PUBLIC_APPWRITE_COL_MESSAGES_ID=${{ vars.PUBLIC_APPWRITE_COL_MESSAGES_ID }}" | |
| "PUBLIC_APPWRITE_FN_TLDR_ID=${{ vars.PUBLIC_APPWRITE_FN_TLDR_ID }}" | |
| "PUBLIC_APPWRITE_PROJECT_INIT_ID=${{ vars.PUBLIC_APPWRITE_PROJECT_INIT_ID }}" | |
| "PUBLIC_GROWTH_ENDPOINT=${{ vars.PUBLIC_GROWTH_ENDPOINT }}" | |
| "PUBLIC_POSTHOG_API_KEY=${{ vars.PUBLIC_POSTHOG_API_KEY }}" | |
| "APPWRITE_DB_INIT_ID=${{ secrets.APPWRITE_DB_INIT_ID }}" | |
| "APPWRITE_COL_INIT_ID=${{ secrets.APPWRITE_COL_INIT_ID }}" | |
| "APPWRITE_API_KEY_INIT=${{ secrets.APPWRITE_API_KEY_INIT }}" | |
| "GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" | |
| "SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}" | |
| "SENTRY_RELEASE=${{ github.event.release.tag_name }}" | |
| deploy_kubernetes: | |
| strategy: | |
| matrix: | |
| region: [{ full: fra1, short: fra }] | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout the repo | |
| uses: actions/checkout@v4 | |
| - name: Install Kubectl | |
| uses: azure/setup-kubectl@v4 | |
| - name: Install Helm | |
| uses: azure/setup-helm@v4 | |
| - name: Install doctl | |
| uses: digitalocean/action-doctl@v2 | |
| with: | |
| token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} | |
| - name: Save DigitalOcean kubeconfig with short-lived credentials | |
| run: doctl kubernetes cluster kubeconfig save --expiry-seconds 600 assets-${{ matrix.region.full }}-prod | |
| - name: Ensure namespaces exist | |
| run: | | |
| kubectl create namespace website --dry-run=client -o yaml | kubectl apply -f - | |
| - name: Create docker pull secret | |
| run: | | |
| kubectl -n website create secret docker-registry ghcr \ | |
| --docker-server=ghcr.io \ | |
| --docker-username=${{ secrets.GHCR_USERNAME }} \ | |
| --docker-password=${{ secrets.GHCR_TOKEN }} \ | |
| [email protected] \ | |
| --dry-run=client -o yaml | kubectl apply -f - | |
| - name: Deploy | |
| run: | | |
| helm upgrade --install --namespace website website deploy/website/ \ | |
| --values deploy/website/environments/production/${{ matrix.region.full }}.values.yaml \ | |
| --set imagePullSecret='ghcr' \ | |
| --set version=${{ env.TAG }} |