|
| 1 | +name: Update Data Model and Template |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + repository_dispatch: |
| 6 | + types: [OpenActive.NET-update,data-models-update,dataset-site-template-update] |
| 7 | + |
| 8 | +jobs: |
| 9 | + generate: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + |
| 12 | + steps: |
| 13 | + - name: Checkout OpenActive.DatasetSite.NET |
| 14 | + uses: actions/checkout@v2 |
| 15 | + with: |
| 16 | + ref: master |
| 17 | + |
| 18 | + - name: Setup Node.js 14.x |
| 19 | + uses: actions/setup-node@v1 |
| 20 | + with: |
| 21 | + node-version: 14.x |
| 22 | + |
| 23 | + - name: Setup .NET Core 3.1.x |
| 24 | + uses: actions/setup-dotnet@v1 |
| 25 | + with: |
| 26 | + dotnet-version: 3.1.x |
| 27 | + |
| 28 | + - name: Install OpenActive.DatasetSite.NET.Generator |
| 29 | + run: npm install |
| 30 | + working-directory: ./OpenActive.DatasetSite.NET.Generator/ |
| 31 | + |
| 32 | + - name: Update OpenActive.DatasetSite.NET.Generator with latest data-models and dataset-site-template |
| 33 | + run: npm update @openactive/data-models @opoenactive/dataset-site-template |
| 34 | + working-directory: ./OpenActive.DatasetSite.NET.Generator/ |
| 35 | + |
| 36 | + - name: Run .NET dataset site generator |
| 37 | + run: npm start |
| 38 | + working-directory: ./OpenActive.DatasetSite.NET.Generator/ |
| 39 | + |
| 40 | + - name: Update OpenActive.NET to latest version |
| 41 | + run: dotnet add package OpenActive.NET |
| 42 | + working-directory: ./OpenActive.DatasetSite.NET/ |
| 43 | + |
| 44 | + - name: Create Pull Request |
| 45 | + id: cpr |
| 46 | + uses: peter-evans/create-pull-request@v3 |
| 47 | + with: |
| 48 | + path: . |
| 49 | + token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }} |
| 50 | + commit-message: Update data models and dataset site template |
| 51 | + committer: openactive-bot <openactive-bot@users.noreply.github.com> |
| 52 | + author: openactive-bot <openactive-bot@users.noreply.github.com> |
| 53 | + signoff: false |
| 54 | + branch: ci/update-data-models |
| 55 | + delete-branch: true |
| 56 | + title: 'Update data models and dataset site template' |
| 57 | + body: | |
| 58 | + Update to use latest version of data models based on the [OpenActive Vocabulary](https://openactive.io/ns/) (codified by the [Data Models](https://github.com/openactive/data-models)), and the latest version of the [Dataset Site Template](https://github.com/openactive/dataset-site-template) |
| 59 | + labels: | |
| 60 | + automated pr |
| 61 | + team-reviewers: | |
| 62 | + owners |
| 63 | + maintainers |
| 64 | + draft: false |
| 65 | + |
| 66 | + - name: Check outputs |
| 67 | + run: | |
| 68 | + echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" |
| 69 | + echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" |
0 commit comments