TDR Deploy Generated Graphql #400
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: TDR Deploy Generated Graphql | |
on: | |
workflow_dispatch: | |
inputs: | |
ts-only: | |
default: false | |
description: Whether to deploy to npm only | |
required: false | |
type: boolean | |
env: | |
RUN_NUMBER: ${{ github.run_id }}${{ github.run_attempt }} | |
BRANCH_NAME: version-bump-${{ github.run_id }}${{ github.run_attempt }} | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Import GPG key | |
id: import_gpg | |
uses: crazy-max/ghaction-import-gpg@v4 | |
with: | |
git_user_signingkey: true | |
git_commit_gpgsign: true | |
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | |
passphrase: ${{ secrets.GPG_PASSPHRASE }} | |
- run: ./.github/scripts/setup.sh | |
- run: | | |
./.github/scripts/deploy_npm.sh ${{ secrets.NPM_TOKEN }} | |
id: deploy-npm | |
- if: ${{ github.event.inputs.ts-only == 'false' }} | |
id: build | |
run: | | |
sbt 'release with-defaults' | |
env: | |
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | |
- name: Create Pull Request | |
run: gh pr create --fill --label 'Version bump' | |
env: | |
GITHUB_TOKEN: ${{ secrets.WORKFLOW_PAT }} | |
- if: ${{ github.event.inputs.ts-only == 'false' }} | |
name: Send success message | |
uses: nationalarchives/tdr-github-actions/.github/actions/slack-send@main | |
with: | |
message: ":white_check_mark: Generated graphql ${{ steps.build.outputs.latest-tag }} has been published" | |
slack-url: ${{ secrets.SLACK_WEBHOOK }} | |
- name: Send success message | |
uses: nationalarchives/tdr-github-actions/.github/actions/slack-send@main | |
with: | |
message: ":white_check_mark: Generated graphql ${{ steps.deploy-npm.outputs.set-npm-version }} has been published to npm" | |
slack-url: ${{ secrets.SLACK_WEBHOOK }} |