build(deps): bump webfactory/ssh-agent from 0.8.0 to 0.9.1 (#28) #4
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 to staging | ||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| targets: | ||
| required: true | ||
| type: string | ||
| name: | ||
| type: string | ||
| default: '' | ||
| action: | ||
| description: 'opened|reopened|synchronize|closed' | ||
| type: string | ||
| required: true | ||
| secrets: | ||
| token: | ||
| required: true | ||
| staging-token: | ||
| required: true | ||
| required: true | ||
| private-key: | ||
| required: true | ||
| docker-username: | ||
| required: true | ||
| docker-password: | ||
| required: true | ||
| jobs: | ||
| prepare-url: | ||
| name: Prepare URL | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| url: ${{ steps.set-url.outputs.url }} | ||
| strategy: | ||
| matrix: | ||
| target: ${{ fromJson(inputs.targets) }} | ||
| steps: | ||
| - name: Set URL | ||
| id: set-url | ||
| run: | | ||
| if [ "${{ matrix.target }}" == "lemon-v2" ]; then | ||
| echo "url=https://staging-${{ inputs.name }}-beta.lemon.fr" >> $GITHUB_OUTPUT | ||
| elif [ "${{ matrix.target }}" == "lemon" ]; then | ||
| echo "url=https://staging-${{ inputs.name }}.lemon.fr" >> $GITHUB_OUTPUT | ||
| elif [ "${{ matrix.target }}" == "traack" ]; then | ||
| echo "url=https://staging-${{ inputs.name }}.traack.io" >> $GITHUB_OUTPUT | ||
| else | ||
| echo "url=https://staging-${{ inputs.name }}.${{ matrix.target }}.com" >> $GITHUB_OUTPUT | ||
| fi | ||
| deploy: | ||
| name: Deploy Staging | ||
| if: ${{ always() && inputs.name != '' }} | ||
| runs-on: self-hosted | ||
| timeout-minutes: 30 | ||
| needs: prepare-url | ||
| strategy: | ||
| matrix: | ||
| target: ${{ fromJson(inputs.targets) }} | ||
| environment: | ||
| name: staging-${{ inputs.name }} (${{ matrix.target }}) | ||
| url: ${{ needs.prepare-url.outputs.url }} | ||
| steps: | ||
| - name: Checkout Humanoid CI | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| repository: Humanoidfr/humanoid-ci | ||
| token: ${{ secrets.token }} | ||
| path: .github/actions/humanoid-ci | ||
| - name: Create/update "${{ inputs.name }}" ${{ matrix.target }} staging environment | ||
| if: ${{ inputs.action == 'opened' || inputs.action == 'reopened' || inputs.action == 'synchronize' }} | ||
| env: | ||
| HUMANOID_TOKEN: ${{ secrets.staging-token }} | ||
| IS_WOODY: true | ||
| run: | | ||
| python3 ./.github/actions/humanoid-ci/scripts/preprod.py clone ${{ matrix.target }} ${{ inputs.name }} ${{ inputs.name }} "${{ github.event.pull_request.html_url }}" ${{ toJson(github.event.pull_request.body) }} "${{ github.event.pull_request.user.avatar_url }}" | ||
| # echo "s3_url=http://$(pulumi stack output bucketUrl)" >> $GITHUB_OUTPUT | ||
| - name: Delete "${{ inputs.name }}" ${{ matrix.target }} staging environment | ||
| if: ${{ inputs.action == 'closed' }} | ||
| env: | ||
| HUMANOID_TOKEN: ${{ secrets.staging-token }} | ||
| IS_WOODY: true | ||
| run: | | ||
| python3 ./.github/actions/humanoid-ci/scripts/preprod.py delete ${{ matrix.target }} ${{ inputs.name }} | ||