apisix_dev_push_docker_hub.yaml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. name: Build and Push apisix-dev to Docker DockerHub
  2. on:
  3. schedule:
  4. # UTC 0:00 AM (See https://pubs.opengroup.org/onlinepubs/9699919799/utilities/crontab.html#tag_20_25_07)
  5. - cron: "0 1 * * *"
  6. push:
  7. branches: [master]
  8. paths-ignore:
  9. - 'docs/**'
  10. - '**/*.md'
  11. jobs:
  12. build:
  13. runs-on: ubuntu-latest
  14. env:
  15. APISIX_VERSION: master
  16. APISIX_DOCKER_TAG: master-debian-dev
  17. steps:
  18. - name: Check out the repo
  19. uses: actions/checkout@v2
  20. - name: Build and run
  21. run: |
  22. make build-on-debian-dev
  23. docker-compose -f ./compose/docker-compose-master.yaml up -d
  24. sleep 30
  25. docker logs compose_apisix_1
  26. - name: Test APISIX
  27. run: |
  28. grep -C 3 '\[error\]' compose/apisix_log/error.log && exit 1
  29. curl http://127.0.0.1:9180/apisix/admin/routes/1 \
  30. -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
  31. {
  32. "uri": "/get",
  33. "upstream": {
  34. "type": "roundrobin",
  35. "nodes": {
  36. "httpbin.org:80": 1
  37. }
  38. }
  39. }'
  40. result_code=`curl -I -m 10 -o /dev/null -s -w %{http_code} http://127.0.0.1:9080/get`
  41. if [[ $result_code -ne 200 ]];then
  42. printf "result_code: %s\n" "$result_code"
  43. exit 125
  44. fi
  45. - name: Login to Docker Hub
  46. uses: docker/login-action@v1
  47. with:
  48. username: ${{ secrets.DOCKERHUB_USER }}
  49. password: ${{ secrets.DOCKERHUB_TOKEN }}
  50. - name: Set up QEMU
  51. uses: docker/setup-qemu-action@v1
  52. - name: Set up Docker Buildx
  53. uses: docker/setup-buildx-action@v1
  54. - name: Push apisix image to Docker Hub
  55. run: |
  56. make push-multiarch-dev-on-debian