Deploy - Contentful Migrations #6
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: Deploy - Contentful Migrations | |
on: | |
workflow_dispatch: | |
inputs: | |
target_environment: | |
required: true | |
description: 'Contentful environment to deploy to' | |
default: 'development' | |
type: choice | |
options: | |
- development | |
- staging | |
- production | |
jobs: | |
contentful: | |
runs-on: ubuntu-latest | |
name: Run Contentful Migrations | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set Node.js 20.x | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
- name: Install Contentful CLI | |
run: npm install -g contentful-cli | |
- name: Login to Contentful with management token | |
run: contentful login --management-token "${{ secrets.CONTENTFUL_MANAGEMENT_TOKEN }}" | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.x | |
cache: true | |
cache-dependency-path: | | |
src/contentful/CareLeavers.ContentfulMigration/packages.lock.json | |
- name: Deploy Contentful migrations | |
working-directory: ./src/contentful/CareLeavers.ContentfulMigration | |
env: | |
ContentfulOptions__DeliveryApiKey: ${{ secrets.CONTENTFUL_DELIVERY_API_KEY }} | |
ContentfulOptions__SpaceId: ${{ secrets.CONTENTFUL_SPACE_ID }} | |
ContentfulOptions__ManagementApiKey: ${{ secrets.CONTENTFUL_MANAGEMENT_TOKEN }} | |
ContentfulOptions__Environment: ${{ github.event.inputs.target_environment }} | |
run: dotnet run |