feat(docs): add version of packages (#781) #452
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy Staging | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
name: Build Images | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup Gcloud Auth | |
uses: google-github-actions/auth@v1 | |
with: | |
credentials_json: "${{ secrets.ORG_SANDBOX_DEPLOYMENT_KEY }}" | |
- name: Setup Cloud SDK | |
uses: google-github-actions/setup-gcloud@v1 | |
- name: Set Image Tag | |
id: lookup | |
run: echo "version=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
- run: | | |
gcloud auth list | |
gcloud auth configure-docker -q | |
echo "VERSION: ${{ steps.lookup.outputs.version }}" | |
- name: Build and Push Images | |
run: | | |
./k8s/build-img.py -p staging | |
env: | |
BACKEND_URL: ${{ secrets.STAGING_NEXT_PUBLIC_BACKEND_URL }} | |
NEXT_PUBLIC_GOOGLE_ANALYTICS_TRACKING_ID: ${{ secrets.NEXT_PUBLIC_GOOGLE_ANALYTICS_TRACKING_ID }} | |
NEXT_PUBLIC_ALGOLIA_APP_ID: ${{ secrets.NEXT_PUBLIC_ALGOLIA_APP_ID }} | |
NEXT_PUBLIC_ALGOLIA_API_KEY: ${{ secrets.NEXT_PUBLIC_ALGOLIA_API_KEY }} | |
NEXT_PUBLIC_ALGOLIA_INDEX: ${{ secrets.NEXT_PUBLIC_ALGOLIA_INDEX }} | |
NEWSLETTER_BASE_URL: ${{ secrets.NEWSLETTER_BASE_URL }} | |
SENDER_TOKEN: ${{ secrets.SENDER_TOKEN }} | |
deploy: | |
name: Deployment | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup Gcloud Auth | |
uses: google-github-actions/auth@v1 | |
with: | |
credentials_json: "${{ secrets.ORG_SANDBOX_DEPLOYMENT_KEY }}" | |
- name: Setup Cloud SDK | |
uses: google-github-actions/setup-gcloud@v1 | |
- name: Set Image Tag | |
id: lookup | |
run: echo "version=$(git describe --always --dirty=-wip)" >> $GITHUB_OUTPUT | |
- name: Turnstyle | |
uses: softprops/turnstyle@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Deploy to Staging | |
env: | |
IMAGE_TAG: ${{ steps.lookup.outputs.version }} | |
HELM_NAME: staging | |
NAMESPACE: docs-staging | |
GKE_PROJECT: fetch-ai-sandbox | |
GKE_CLUSTER: london-b | |
GKE_ZONE: europe-west2-b | |
run: | | |
gcloud components install gke-gcloud-auth-plugin | |
gcloud container clusters get-credentials $GKE_CLUSTER \ | |
--zone $GKE_ZONE \ | |
--project $GKE_PROJECT | |
helm upgrade --install --wait --timeout 300s $HELM_NAME \ | |
./k8s/docs/ \ | |
--set-string website.image.tag=$IMAGE_TAG \ | |
-n $NAMESPACE |