Skip to content

Commit

Permalink
Merge branch 'develop' into main
Browse files Browse the repository at this point in the history
# Conflicts:
#	.dockerignore
#	.gitignore
  • Loading branch information
allburov committed Aug 14, 2022
2 parents 0d3bb31 + be3025c commit 23a73b4
Show file tree
Hide file tree
Showing 10 changed files with 21,037 additions and 4,182 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Release

on:
push:
tags:
- "*"

jobs:
deploy-docker:
runs-on: ubuntu-latest

needs: deploy-pypi
steps:
- uses: actions/checkout@v2

- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: allburov/whatsapp-http-api
flavor: latest=true
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
- name: Login to image repository
if: github.ref_type == 'tag'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
file: Dockerfile
push: ${{ github.ref_type == 'tag' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:10
FROM node:15
# Chrome
RUN apt-get update \
&& apt-get install -y wget gnupg \
Expand Down
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
build:
docker build . -t allburov/whatsapp-http-api

run:
docker run -it -v `pwd`/tokens:/app/tokens -p 127.0.0.1:3000:3000/tcp allburov/whatsapp-http-api

push:
docker push allburov/whatsapp-http-api
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ docker pull allburov/whatsapp-http-api
Run WhatsApp HTTP API:

```bash
docker pull allburov/whatsapp-http-api
docker run -it -v `pwd`/tokens:/app/tokens -p 127.0.0.1:3000:3000/tcp allburov/whatsapp-http-api
```

Expand All @@ -60,6 +61,10 @@ Let's try to send a message:

```bash
# Phone without +
# Using GET
curl "http://localhost:3000/api/sendText?phone=79776772457&text=Hello+from+WhatsApp+HTTP+API+Free!"

# Using POST
export PHONE=79776772457
curl -d "{\"chatId\": \"${PHONE}@c.us\", \"text\": \"Hello from WhatsApp HTTP API Free\" }" -H "Content-Type: application/json" -X POST http://localhost:3000/api/sendText
```
Expand Down
Loading

0 comments on commit 23a73b4

Please sign in to comment.