apisix_dev_push_docker_hub.yaml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. curl http://127.0.0.1:9180/apisix/admin/routes/1 \
  29. -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
  30. {
  31. "uri": "/get",
  32. "upstream": {
  33. "type": "roundrobin",
  34. "nodes": {
  35. "httpbin.org:80": 1
  36. }
  37. }
  38. }'
  39. result_code=`curl -I -m 10 -o /dev/null -s -w %{http_code} http://127.0.0.1:9080/get`
  40. if [[ $result_code -ne 200 ]];then
  41. printf "result_code: %s\n" "$result_code"
  42. exit 125
  43. fi
  44. - name: Login to Docker Hub
  45. uses: docker/login-action@v1
  46. with:
  47. username: ${{ secrets.DOCKERHUB_USER }}
  48. password: ${{ secrets.DOCKERHUB_TOKEN }}
  49. - name: Set up QEMU
  50. uses: docker/setup-qemu-action@v1
  51. - name: Set up Docker Buildx
  52. uses: docker/setup-buildx-action@v1
  53. - name: Push apisix image to Docker Hub
  54. run: |
  55. make push-multiarch-dev-on-debian