Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/workflows/deploy-stage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Deploy to stage

# Manually deploy the branch you run this from to one of the docs stage
# services in the docs-prod project (8OhtUz1ISOCzykK3CUplng).
on:
workflow_dispatch:
inputs:
target:
description: 'Stage service to deploy to'
required: true
default: docsstage1
type: choice
options:
- docsstage1
- docsstage2
- docsstage3

jobs:
deploy:
name: deploy
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Resolve service ID
id: svc
run: |
case "${{ github.event.inputs.target }}" in
docsstage1) id=FXMA8YzYSQqVTTlBmAMmpQ ;;
docsstage2) id=wz153TNtQluTG0XBXzXHbg ;;
docsstage3) id=VNNJrIhWRCO1924gAXHkHg ;;
*) echo "Unknown target '${{ github.event.inputs.target }}'" && exit 1 ;;
esac
echo "id=$id" >> "$GITHUB_OUTPUT"

- name: Install Zerops CLI
run: |
curl -L https://github.com/zeropsio/zcli/releases/latest/download/zcli-linux-amd64 -o /usr/local/bin/zcli
chmod +x /usr/local/bin/zcli

- name: Login to Zerops
run: zcli login "${{ secrets.ZEROPS_TOKEN }}"

- name: Deploy to Zerops
run: |
zcli push \
--service-id "${{ steps.svc.outputs.id }}" \
--setup docs \
--version-name "${GITHUB_REF_NAME}-$(echo "${GITHUB_SHA}" | cut -c1-7)"
Loading