Refactor Docker setup in CD to include build arguments for environmen… #7
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: CD | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - v* | |
| jobs: | |
| build: | |
| permissions: | |
| contents: read | |
| packages: write | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: docker/setup-buildx-action@v3 | |
| - uses: docker/login-action@v3 | |
| with: | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| - uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| build-args: | | |
| VITE_BASE_API_URL=${{ vars.VITE_BASE_API_URL }} | |
| VITE_CLOUDFLARE_TURNSTILE_ENABLED=${{ vars.VITE_CLOUDFLARE_TURNSTILE_ENABLED }} | |
| VITE_CLOUDFLARE_TURNSTILE_SITE_KEY=${{ secrets.VITE_CLOUDFLARE_TURNSTILE_SITE_KEY }} | |
| push: true | |
| tags: | | |
| ghcr.io/${{ github.repository }}:latest | |
| ghcr.io/${{ github.repository }}:${{ github.sha }} |