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.3 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
  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: Login to Registry
  12. uses: docker/login-action@v3
  13. with:
  14. username: ${{ secrets.DOCKERHUB_USERNAME }}
  15. password: ${{ secrets.DOCKERHUB_PASSWORD }}
  16. - name: Docker metadata
  17. id: meta
  18. uses: docker/metadata-action@v5
  19. with:
  20. images: |
  21. huggingface/chat-ui
  22. tags: |
  23. type=raw,value=latest,enable={{is_default_branch}}
  24. type=sha,enable={{is_default_branch}}
  25. - name: Set up Docker Buildx
  26. uses: docker/setup-buildx-action@v3
  27. - name: Build and Publish HuggingChat image
  28. uses: docker/build-push-action@v5
  29. with:
  30. context: .
  31. file: Dockerfile
  32. push: ${{ github.event_name != 'pull_request' }}
  33. tags: ${{ steps.meta.outputs.tags }}
  34. labels: ${{ steps.meta.outputs.labels }}
  35. platforms: linux/amd64
  36. cache-to: type=gha,mode=max,scope=amd64
  37. cache-from: type=gha,scope=amd64
  38. provenance: false
  39. build-args: |
  40. INCLUDE_DB=false
  41. APP_BASE=/chat
  42. PUBLIC_APP_COLOR=yellow
  43. deploy:
  44. name: Deploy on prod
  45. runs-on: ubuntu-latest
  46. needs: ["build-and-publish-huggingchat-image"]
  47. steps:
  48. - name: Inject slug/short variables
  49. uses: rlespinasse/github-slug-action@v4.5.0
  50. - name: Gen values
  51. run: |
  52. VALUES=$(cat <<-END
  53. image:
  54. tag: "sha-${{ env.GITHUB_SHA_SHORT }}"
  55. END
  56. )
  57. echo "VALUES=$(echo "$VALUES" | yq -o=json | jq tostring)" >> $GITHUB_ENV
  58. - name: Deploy on infra-deployments
  59. uses: aurelien-baudet/workflow-dispatch@v2
  60. with:
  61. workflow: Update application values
  62. repo: huggingface/infra-deployments
  63. wait-for-completion: true
  64. wait-for-completion-interval: 10s
  65. display-workflow-run-url-interval: 10s
  66. ref: refs/heads/main
  67. token: ${{ secrets.ARGO_CD_TOKEN }}
  68. 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...