Spaces:
Paused
Paused
Clean up internal image action (#1100)
Browse files* Clean up internal image action
* Add deploy step
.github/workflows/deploy-prod.yml
CHANGED
|
@@ -15,16 +15,6 @@ jobs:
|
|
| 15 |
with:
|
| 16 |
authkey: ${{ secrets.TAILSCALE_AUTHKEY }}
|
| 17 |
|
| 18 |
-
- name: Extract package version
|
| 19 |
-
id: package-version
|
| 20 |
-
run: |
|
| 21 |
-
VERSION=$(jq -r .version package.json)
|
| 22 |
-
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
|
| 23 |
-
MAJOR=$(echo $VERSION | cut -d '.' -f1)
|
| 24 |
-
echo "MAJOR=$MAJOR" >> $GITHUB_OUTPUT
|
| 25 |
-
MINOR=$(echo $VERSION | cut -d '.' -f1).$(echo $VERSION | cut -d '.' -f2)
|
| 26 |
-
echo "MINOR=$MINOR" >> $GITHUB_OUTPUT
|
| 27 |
-
|
| 28 |
- name: Docker metadata
|
| 29 |
id: meta
|
| 30 |
uses: docker/metadata-action@v5
|
|
@@ -32,15 +22,9 @@ jobs:
|
|
| 32 |
images: |
|
| 33 |
registry.internal.huggingface.tech/chat-ui/chat-ui
|
| 34 |
tags: |
|
| 35 |
-
type=raw,value=${{ steps.package-version.outputs.VERSION }},enable=${{github.event_name == 'release'}}
|
| 36 |
-
type=raw,value=${{ steps.package-version.outputs.MAJOR }},enable=${{github.event_name == 'release'}}
|
| 37 |
-
type=raw,value=${{ steps.package-version.outputs.MINOR }},enable=${{github.event_name == 'release'}}
|
| 38 |
type=raw,value=latest,enable={{is_default_branch}}
|
| 39 |
type=sha,enable={{is_default_branch}}
|
| 40 |
|
| 41 |
-
- name: Set up QEMU
|
| 42 |
-
uses: docker/setup-qemu-action@v3
|
| 43 |
-
|
| 44 |
- name: Set up Docker Buildx
|
| 45 |
uses: docker/setup-buildx-action@v3
|
| 46 |
|
|
@@ -51,7 +35,7 @@ jobs:
|
|
| 51 |
username: ${{ secrets.DOCKER_INTERNAL_USERNAME }}
|
| 52 |
password: ${{ secrets.DOCKER_INTERNAL_PASSWORD }}
|
| 53 |
|
| 54 |
-
- name: Build and Publish
|
| 55 |
uses: docker/build-push-action@v5
|
| 56 |
with:
|
| 57 |
context: .
|
|
@@ -67,3 +51,22 @@ jobs:
|
|
| 67 |
INCLUDE_DB=false
|
| 68 |
APP_BASE=/chat
|
| 69 |
PUBLIC_APP_COLOR=yellow
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
with:
|
| 16 |
authkey: ${{ secrets.TAILSCALE_AUTHKEY }}
|
| 17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
- name: Docker metadata
|
| 19 |
id: meta
|
| 20 |
uses: docker/metadata-action@v5
|
|
|
|
| 22 |
images: |
|
| 23 |
registry.internal.huggingface.tech/chat-ui/chat-ui
|
| 24 |
tags: |
|
|
|
|
|
|
|
|
|
|
| 25 |
type=raw,value=latest,enable={{is_default_branch}}
|
| 26 |
type=sha,enable={{is_default_branch}}
|
| 27 |
|
|
|
|
|
|
|
|
|
|
| 28 |
- name: Set up Docker Buildx
|
| 29 |
uses: docker/setup-buildx-action@v3
|
| 30 |
|
|
|
|
| 35 |
username: ${{ secrets.DOCKER_INTERNAL_USERNAME }}
|
| 36 |
password: ${{ secrets.DOCKER_INTERNAL_PASSWORD }}
|
| 37 |
|
| 38 |
+
- name: Build and Publish HuggingChat image
|
| 39 |
uses: docker/build-push-action@v5
|
| 40 |
with:
|
| 41 |
context: .
|
|
|
|
| 51 |
INCLUDE_DB=false
|
| 52 |
APP_BASE=/chat
|
| 53 |
PUBLIC_APP_COLOR=yellow
|
| 54 |
+
|
| 55 |
+
deploy:
|
| 56 |
+
name: Deploy on prod
|
| 57 |
+
runs-on: ubuntu-latest
|
| 58 |
+
needs: ["build-and-publish-huggingchat-image"]
|
| 59 |
+
steps:
|
| 60 |
+
- name: Set GITHUB_SHA_SHORT
|
| 61 |
+
run: echo "GITHUB_SHA_SHORT=${{ env.GITHUB_EVENT_PULL_REQUEST_HEAD_SHA_SHORT }}" >> $GITHUB_ENV
|
| 62 |
+
- name: Deploy on infra-deployments
|
| 63 |
+
uses: aurelien-baudet/workflow-dispatch@v2
|
| 64 |
+
with:
|
| 65 |
+
workflow: Update application values
|
| 66 |
+
repo: huggingface/infra-deployments
|
| 67 |
+
wait-for-completion: true
|
| 68 |
+
wait-for-completion-interval: 10s
|
| 69 |
+
display-workflow-run-url-interval: 10s
|
| 70 |
+
ref: refs/heads/main
|
| 71 |
+
token: ${{ secrets.ARGO_CD_TOKEN }}
|
| 72 |
+
inputs: '{"path": "hub/chat-ui/chat-ui.yaml", "values": ${{ env.GITHUB_SHA_SHORT }}, "url": "${{ github.event.head_commit.url }}"}'
|