Update workflow from canonical template #35
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: Deploy | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| inputs: | |
| action: | |
| description: "Whether to deploy up or down" | |
| required: true | |
| default: "up" | |
| type: choice | |
| options: | |
| - up | |
| - down | |
| stack: | |
| description: "The stack to deploy up or down. (Leave blank for default)" | |
| default: "" | |
| jobs: | |
| defang: | |
| name: Defang ${{ github.event.inputs.action || 'up' }} ${{ | |
| github.event.inputs.stack || 'default stack' }} | |
| environment: production | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| concurrency: | |
| cancel-in-progress: false | |
| group: deploy-${{ github.event.inputs.stack || 'default' }} | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@v4 | |
| - name: Defang ${{ github.event.inputs.action || 'up' }} ${{ | |
| github.event.inputs.stack || 'default stack' }} | |
| uses: DefangLabs/defang-github-action@v1.4.0 | |
| with: | |
| command: ${{ github.event.inputs.action || 'up' }} | |
| stack: ${{ github.event.inputs.stack || '' }} | |
| config-env-vars: DATABASE_URL | |
| env: | |
| DATABASE_URL: ${{ secrets.DATABASE_URL }} | |
| - name: Deployment Summary | |
| uses: DefangLabs/defang-github-action@v1.4.0 | |
| with: | |
| command: services | |
| stack: ${{ github.event.inputs.stack || '' }} |