Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

deploy-prod.yml 2.6 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
  1. name: Deploy to k8s
  2. on:
  3. # run this workflow manually from the Actions tab
  4. workflow_dispatch:
  5. jobs:
  6. build-and-publish-huggingchat-image:
  7. runs-on: ubuntu-latest
  8. steps:
  9. - name: Checkout
  10. uses: actions/checkout@v4
  11. - name: Tailscale
  12. uses: huggingface/tailscale-action@main
  13. with:
  14. authkey: ${{ secrets.TAILSCALE_AUTHKEY }}
  15. - name: Docker metadata
  16. id: meta
  17. uses: docker/metadata-action@v5
  18. with:
  19. images: |
  20. registry.internal.huggingface.tech/chat-ui/chat-ui
  21. tags: |
  22. type=raw,value=latest,enable={{is_default_branch}}
  23. type=sha,enable={{is_default_branch}}
  24. - name: Set up Docker Buildx
  25. uses: docker/setup-buildx-action@v3
  26. - name: Login to Registry
  27. uses: docker/login-action@v2
  28. with:
  29. registry: registry.internal.huggingface.tech
  30. username: ${{ secrets.DOCKER_INTERNAL_USERNAME }}
  31. password: ${{ secrets.DOCKER_INTERNAL_PASSWORD }}
  32. - name: Build and Publish HuggingChat image
  33. uses: docker/build-push-action@v5
  34. with:
  35. context: .
  36. file: Dockerfile
  37. push: ${{ github.event_name != 'pull_request' }}
  38. tags: ${{ steps.meta.outputs.tags }}
  39. labels: ${{ steps.meta.outputs.labels }}
  40. platforms: linux/amd64
  41. cache-to: type=gha,mode=max,scope=amd64
  42. cache-from: type=gha,scope=amd64
  43. provenance: false
  44. build-args: |
  45. INCLUDE_DB=false
  46. APP_BASE=/chat
  47. PUBLIC_APP_COLOR=yellow
  48. deploy:
  49. name: Deploy on prod
  50. runs-on: ubuntu-latest
  51. needs: ["build-and-publish-huggingchat-image"]
  52. steps:
  53. - name: Inject slug/short variables
  54. uses: rlespinasse/github-slug-action@v4.5.0
  55. - name: Gen values
  56. run: |
  57. VALUES=$(cat <<-END
  58. image:
  59. tag: "sha-${{ env.GITHUB_SHA_SHORT }}"
  60. END
  61. )
  62. echo "VALUES=$(echo "$VALUES" | yq -o=json | jq tostring)" >> $GITHUB_ENV
  63. - name: Deploy on infra-deployments
  64. uses: aurelien-baudet/workflow-dispatch@v2
  65. with:
  66. workflow: Update application values
  67. repo: huggingface/infra-deployments
  68. wait-for-completion: true
  69. wait-for-completion-interval: 10s
  70. display-workflow-run-url-interval: 10s
  71. ref: refs/heads/main
  72. token: ${{ secrets.ARGO_CD_TOKEN }}
  73. inputs: '{"path": "hub/chat-ui/chat-ui.yaml", "values": ${{ env.VALUES }}, "url": "${{ github.event.head_commit.url }}"}'
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...