diff --git a/.github/workflows/docker-build-pr.yml b/.github/workflows/docker-build-pr.yml new file mode 100644 index 00000000..05e3c232 --- /dev/null +++ b/.github/workflows/docker-build-pr.yml @@ -0,0 +1,36 @@ +name: Docker Image Build for PRs + +on: + pull_request: + types: [opened, reopened, sychronize] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Docker metadata + id: meta + uses: docker/metadata-action@v4 + with: + images: facebook/whatsapp_proxy + tags: | + type=raw,value={{date 'YYYYMMDD'}} + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Build PR + uses: docker/build-push-action@v3 + with: + context: ./proxy + platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 + push: false + tags: | + ${{ steps.meta.outputs.tags }} + facebook/whatsapp_proxy:latest diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 502cbe64..226b4e8b 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -1,4 +1,4 @@ -name: Docker Image CI +name: Docker Build and PR for Main # Run on every push to main + weekly, Sunday @ midnight # to keep the image fresh @@ -7,9 +7,6 @@ on: branches: [ "main" ] schedule: - cron: "0 0 * * 0" - # On pull-requests only a build is run, not a push to Docker Hub - pull_request: - types: [opened, reopened, synchronize] jobs: @@ -19,7 +16,7 @@ jobs: steps: - uses: actions/checkout@v3 - + - name: Docker metadata id: meta uses: docker/metadata-action@v4 @@ -33,13 +30,13 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - + - name: Login to dockerhub uses: docker/login-action@v2 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - + - name: Build and push uses: docker/build-push-action@v3 with: @@ -49,4 +46,3 @@ jobs: tags: | ${{ steps.meta.outputs.tags }} facebook/whatsapp_proxy:latest - diff --git a/charts/whatsapp-proxy-chart/Chart.yaml b/charts/whatsapp-proxy-chart/Chart.yaml index 53f0a708..2e1340c5 100644 --- a/charts/whatsapp-proxy-chart/Chart.yaml +++ b/charts/whatsapp-proxy-chart/Chart.yaml @@ -17,7 +17,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.0.3 +version: 1.1.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/whatsapp-proxy-chart/templates/service.yaml b/charts/whatsapp-proxy-chart/templates/service.yaml index 22d5c232..c4b154d9 100644 --- a/charts/whatsapp-proxy-chart/templates/service.yaml +++ b/charts/whatsapp-proxy-chart/templates/service.yaml @@ -54,9 +54,24 @@ spec: {{- end}} {{- if .Values.service.stats_port }} - port: {{ .Values.service.stats_port }} - targetPort: {{ .Values.service.stats_port }} + targetPort: 8199 protocol: TCP name: stats {{- end}} + {{- if .Values.service.media_port }} + - port: {{ .Values.service.media_port }} + targetPort: 587 + protocol: TCP + name: media + {{- end}} + + {{- if .Values.service.media_proxy_port }} + - port: {{ .Values.service.media_proxy_port }} + targetPort: 7777 + protocol: TCP + name: media + {{- end}} + + selector: {{- include "whatsapp-proxy-chart.selectorLabels" . | nindent 4 }} diff --git a/charts/whatsapp-proxy-chart/values.yaml b/charts/whatsapp-proxy-chart/values.yaml index d4a16896..52bab0c0 100644 --- a/charts/whatsapp-proxy-chart/values.yaml +++ b/charts/whatsapp-proxy-chart/values.yaml @@ -48,15 +48,18 @@ securityContext: {} # runAsUser: 1000 service: - type: ClusterIP - annotations: {} + type: LoadBalancer + annotations: + service.beta.kubernetes.io/aws-load-balancer-type: nlb port: 8080 - # http_port: 80 - # https_port: 443 - # jabber_port: 5222 - http_proxy_port: 8080 - https_proxy_port: 8443 - jabber_proxy_port: 8222 + http_port: 80 + https_port: 443 + jabber_port: 5222 + media_port: 587 + # http_proxy_port: 8080 + # https_proxy_port: 8443 + # jabber_proxy_port: 8222 + # media_proxy_port: 7777 # stats_port: 8199 ingress: