[publish] lpc_scenic_landmarks #2683
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: Staging -> Production | |
| on: | |
| issues: | |
| types: [ labeled ] | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-22.04 | |
| if: >- | |
| ( | |
| contains(github.event.issue.title, '[publish]') && | |
| contains(github.event.comment.body, '[publish]') && ( | |
| github.event.comment.user.login == 'dhochbaum-dcp'|| | |
| github.event.comment.user.login == 'jpiacentinidcp' | |
| ) | |
| ) || contains(github.event.issue.labels.*.name, 'publish') | |
| env: | |
| AWS_S3_ENDPOINT: ${{ secrets.DO_S3_ENDPOINT }} | |
| AWS_ACCESS_KEY_ID: ${{ secrets.DO_ACCESS_KEY_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.DO_SECRET_ACCESS_KEY }} | |
| AWS_S3_BUCKET: edm-publishing | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Dependencies | |
| run: ./run.sh install | |
| - name: Parse dataset names | |
| shell: python | |
| id: parsing | |
| run: |+ | |
| import os | |
| body = """${{ github.event.issue.body }}""" | |
| splited = body.split('\n') | |
| start = splited.index("```yml")+1 | |
| end = splited.index("```") | |
| datasets=' '.join([i[2:] for i in splited[start:end]]) | |
| os.system('echo "datasets={0}" >> $GITHUB_OUTPUT'.format(datasets)) | |
| - name: test output | |
| run: echo "${{ steps.parsing.outputs.datasets }}" | |
| - name: Run recipe | |
| run: |+ | |
| for i in ${{ steps.parsing.outputs.datasets }} | |
| do | |
| ./run.sh publish $i | |
| done | |
| - name: Success Message | |
| if: success() | |
| uses: peter-evans/close-issue@v1 | |
| with: | |
| issue-number: ${{ github.event.issue.number }} | |
| comment: | | |
| ## Publish Complete! | |
| ${{ steps.parsing.outputs.datasets }} | |
| *Published By: @${{ github.actor }}* for more details, check [here](https://github.com/NYCPlanning/edm-data-operations/actions/runs/${{ github.run_id }}) |