test #304
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: spec-release-pipeline | |
| defaults: | |
| run: | |
| shell: bash # Explicitly sets pipeline to fail if any subprocess fails | |
| on: | |
| push | |
| permissions: read-all | |
| jobs: | |
| deploy-hello-world-spec: | |
| runs-on: ubuntu-latest | |
| env: | |
| PROXYGEN_PRIVATE_KEY: ${{ secrets.ENCODED_HELLO_WORLD_PROXYGEN_PRIVATE_KEY }} | |
| PROXYGEN_KID: ${{ secrets.HELLO_WORLD_PROXYGEN_KID }} | |
| PROXYGEN_CLIENT_ID: ${{ secrets.HELLO_WORLD_PROXYGEN_CLIENT_ID }} | |
| PROXYGEN_API_NAME: hello-world | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v2 | |
| with: | |
| fetch-depth: 0 | |
| - name: Update apt repositories | |
| run: sudo apt update | |
| - name: Get Pull Request Number | |
| id: pr | |
| if: github.ref != 'refs/heads/master' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| pr_number=$(gh pr view --json number -q .number || echo "") | |
| if test -z "$pr_number" | |
| then | |
| echo "Pipeline can't be run on branch other than master without PR number" | |
| exit 1 | |
| else | |
| echo PR number - $pr_number | |
| fi | |
| - name: Install Python 3.9 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.9 | |
| - name: Install Proxygen client | |
| run: | | |
| # Install proxygen cli in isolated environment with pipx | |
| pip install pipx | |
| pipx install proxygen-cli | |
| # Setup proxygen auth and settings | |
| mkdir -p ${HOME}/.proxygen | |
| echo -n $PROXYGEN_PRIVATE_KEY | base64 --decode > ${HOME}/.proxygen/key | |
| envsubst < ./.github/proxygen-credentials-template.yaml > ${HOME}/.proxygen/credentials.yaml | |
| envsubst < ./.github/proxygen-settings.yaml > ${HOME}/.proxygen/settings.yaml | |
| proxygen status | |
| - name: Deploy spec | |
| if: github.ref == 'refs/heads/master' | |
| run: | | |
| proxygen spec publish specification/hello-world.yaml --no-confirm |