Build and Push apisix-dev to Docker DockerHub #1107
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: Build and Push apisix-dev to Docker DockerHub | |
on: | |
schedule: | |
# UTC 0:00 AM (See https://pubs.opengroup.org/onlinepubs/9699919799/utilities/crontab.html#tag_20_25_07) | |
- cron: "0 1 * * *" | |
push: | |
branches: [master] | |
paths-ignore: | |
- 'docs/**' | |
- '**/*.md' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
APISIX_VERSION: master | |
APISIX_DOCKER_TAG: master-debian-dev | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v2 | |
- name: Build and run | |
run: | | |
make build-on-debian-dev | |
docker compose -f ./compose/docker-compose-master.yaml up -d | |
sleep 30 | |
docker logs compose-apisix-1 | |
- name: Test APISIX | |
run: | | |
curl http://127.0.0.1:9180/apisix/admin/routes/1 \ | |
-H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d ' | |
{ | |
"uri": "/get", | |
"upstream": { | |
"type": "roundrobin", | |
"nodes": { | |
"httpbin.org:80": 1 | |
} | |
} | |
}' | |
result_code=`curl -I -m 10 -o /dev/null -s -w %{http_code} http://127.0.0.1:9080/get` | |
if [[ $result_code -ne 200 ]];then | |
printf "result_code: %s\n" "$result_code" | |
exit 125 | |
fi | |
- name: Login to Docker Hub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USER }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Push apisix image to Docker Hub | |
run: | | |
make push-multiarch-dev-on-debian |