EXUI-266: Configure github action to update preview deployment id #16
Workflow file for this run
This file contains 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: Populate Preview Deployment ID | |
on: | |
pull_request: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: tibdex/github-app-token@v1 | |
id: generate-token | |
with: | |
app_id: ${{ secrets.HMCTS_GITHUB_EXUI_APP_ID }} | |
private_key: ${{ secrets.HMCTS_GITHUB_EXUI_PRIVATE_KEY }} | |
- uses: actions/checkout@v3 | |
with: | |
token: ${{ steps.generate-token.outputs.token }} | |
ref: master | |
- name: Populate preview deployment ID | |
run: | | |
cd charts/xui-webapp | |
sed -i 's/PREVIEW_DEPLOYMENT_ID:.*/PREVIEW_DEPLOYMENT_ID: exui-preview-deployment-${{ github.event.number }}/' values.preview.template.yaml | |
cd ../.. | |
git status | |
git diff | |
git config --global user.name "${{github.actor}}" | |
git config --global user.email "${{github.actor_id}}+${{github.actor}}@users.noreply.github.com" | |
git add . | |
git commit -m "Setting Preview Deployment ID" | |
git push origin HEAD:${{ github.ref }} --force | |
echo 'Preview deployment ID populated successfully' | |
shell: bash |