apisix_push_docker_hub.yaml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. name: Push apisix to Docker image
  2. on:
  3. push:
  4. branches: ['release/apisix-**']
  5. jobs:
  6. build:
  7. runs-on: ubuntu-latest
  8. strategy:
  9. fail-fast: false
  10. matrix:
  11. platform:
  12. - centos
  13. - debian
  14. - redhat
  15. env:
  16. APISIX_DOCKER_TAG: 3.4.0-${{ matrix.platform }}
  17. steps:
  18. - name: Check out the repo
  19. uses: actions/checkout@v2
  20. - name: Build and run
  21. run: |
  22. make build-on-${{ matrix.platform }}
  23. docker-compose -f ./compose/docker-compose-release.yaml up -d
  24. sleep 30
  25. docker logs compose_apisix_1
  26. - name: Test route
  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:latest image to docker hub
  55. if: matrix.platform == 'debian'
  56. run: |
  57. make push-multiarch-on-latest
  58. - name: Push apisix:${{ matrix.os }} image to Docker Hub
  59. run: |
  60. make push-multiarch-on-${{ matrix.platform }}