Ui fixes #13
Workflow file for this run
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 Deploy Test to Nexlayer | |
| on: | |
| push: | |
| branches-ignore: | |
| - main | |
| workflow_dispatch: # Allow manual triggering | |
| env: | |
| IMAGE_NAME: nexlayer-website | |
| NEXLAYER_APP_NAME: nexlayer-website | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GHCR_TOKEN }} | |
| - name: Extract metadata for Docker | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ghcr.io/nexlayer/${{ env.IMAGE_NAME }} | |
| tags: | | |
| type=sha,prefix=,format=short | |
| type=raw,value=latest,enable={{is_default_branch}} | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| push: true | |
| platforms: linux/amd64 | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| - name: Update nexlayer.yaml | |
| run: | | |
| # Extract the short SHA | |
| SHORT_SHA=$(echo ${{ github.sha }} | cut -c1-7) | |
| # Update the image in nexlayer.yaml | |
| sed -i "s|image:.*|image: ghcr.io/nexlayer/${{ env.IMAGE_NAME }}:$SHORT_SHA|" nexlayer.yaml | |
| # Display the updated file for verification | |
| cat nexlayer.yaml | |
| - name: Deploy to Nexlayer | |
| run: | | |
| # Deploy to Nexlayer using the API | |
| curl -X POST https://app.nexlayer.io/startUserDeployment \ | |
| -H "Content-Type: text/x-yaml" \ | |
| --data-binary @nexlayer.yaml |