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.5 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
  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: Inject slug/short variables
  28. uses: rlespinasse/github-slug-action@v4.5.0
  29. - name: Build and Publish HuggingChat image
  30. uses: docker/build-push-action@v5
  31. with:
  32. context: .
  33. file: Dockerfile
  34. push: ${{ github.event_name != 'pull_request' }}
  35. tags: ${{ steps.meta.outputs.tags }}
  36. labels: ${{ steps.meta.outputs.labels }}
  37. platforms: linux/amd64
  38. cache-to: type=gha,mode=max,scope=amd64
  39. cache-from: type=gha,scope=amd64
  40. provenance: false
  41. build-args: |
  42. INCLUDE_DB=false
  43. APP_BASE=/chat
  44. PUBLIC_APP_COLOR=yellow
  45. PUBLIC_COMMIT_SHA=${{ env.GITHUB_SHA_SHORT }}
  46. deploy:
  47. name: Deploy on prod
  48. runs-on: ubuntu-latest
  49. needs: ["build-and-publish-huggingchat-image"]
  50. steps:
  51. - name: Inject slug/short variables
  52. uses: rlespinasse/github-slug-action@v4.5.0
  53. - name: Gen values
  54. run: |
  55. VALUES=$(cat <<-END
  56. image:
  57. tag: "sha-${{ env.GITHUB_SHA_SHORT }}"
  58. END
  59. )
  60. echo "VALUES=$(echo "$VALUES" | yq -o=json | jq tostring)" >> $GITHUB_ENV
  61. - name: Deploy on infra-deployments
  62. uses: aurelien-baudet/workflow-dispatch@v2
  63. with:
  64. workflow: Update application values
  65. repo: huggingface/infra-deployments
  66. wait-for-completion: true
  67. wait-for-completion-interval: 10s
  68. display-workflow-run-url-interval: 10s
  69. ref: refs/heads/main
  70. token: ${{ secrets.GIT_TOKEN_INFRA_DEPLOYMENT }}
  71. 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...