feat: Complete API reference with Generated Code Examples page #10
This file contains hidden or 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: Build and Push to GHCR | |
| on: | |
| push: | |
| branches: | |
| - master | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_NAME: getlumos/docs-lumos | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Extract metadata for Docker | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
| tags: | | |
| type=raw,value=latest | |
| type=sha,prefix=sha- | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| build-args: | | |
| DEPLOY_BRANCH=${{ github.ref_name }} | |
| DEPLOY_COMMIT=${{ github.sha }} | |
| DEPLOY_TIME=${{ github.event.head_commit.timestamp }} | |
| - name: Image published | |
| run: | | |
| echo "Image pushed to ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest" | |
| echo "Pull command: docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest" | |
| deploy-to-vps: | |
| needs: build-and-push | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Deploy to VPS | |
| uses: appleboy/ssh-action@v1.0.3 | |
| with: | |
| host: ${{ secrets.VPS_HOST }} | |
| username: ${{ secrets.VPS_USER }} | |
| key: ${{ secrets.VPS_SSH_KEY }} | |
| script: | | |
| cd ~/app | |
| docker pull ghcr.io/getlumos/docs-lumos:latest | |
| docker compose down || true | |
| docker compose up -d | |
| docker image prune -f | |
| echo "Deployment completed successfully!" |