Skip to content

Commit

Permalink
Merge pull request #25 from Fdawgs/ci/cd
Browse files Browse the repository at this point in the history
ci(workflows): move release steps into `cd` workflow
  • Loading branch information
Fdawgs committed Mar 3, 2021
2 parents 4a53cba + b8743a3 commit 2f92f5e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 19 deletions.
26 changes: 20 additions & 6 deletions .github/workflows/cd.yml
@@ -1,22 +1,36 @@
name: CD

on:
release:
# This specifies that the build will be triggered when we release
types: [released]
push:
branches:
- master
# Allows this workflow to be run manually from the Actions tab
workflow_dispatch:

jobs:
build:
name: Publish to NPM
release:
name: Create/Update Release Pull Request
runs-on: ubuntu-latest
steps:
- name: Release Please
id: release
uses: GoogleCloudPlatform/release-please-action@v2.20.1
with:
changelog-types: '[ { "type": "feat", "section": "Features", "hidden": false }, { "type": "fix", "section": "Bug Fixes", "hidden": false }, { "type": "build", "section": "Dependencies", "hidden": false }, { "type": "chore", "section": "Miscellaneous", "hidden": false }, { "type": "ci", "section": "Miscellaneous", "hidden": false }, { "type": "perf", "section": "Performance", "hidden": false }, { "type": "refactor", "section": "Miscellaneous", "hidden": false }, { "type": "style", "section": "Miscellaneous", "hidden": false }, { "type": "docs", "section": "Documentation", "hidden": false }]'
release-type: node
package-name: fastify-disablecache

- uses: actions/checkout@v2.3.4
if: steps.release.outputs.release_created

- uses: actions/setup-node@v2.1.5
with:
node-version: 14
registry-url: https://registry.npmjs.org/
- run: npm publish --ignore-scripts
if: steps.release.outputs.release_created

- name: Publish to NPM
if: steps.release.outputs.release_created
run: npm publish --ignore-scripts
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
13 changes: 0 additions & 13 deletions .github/workflows/ci.yml
Expand Up @@ -88,16 +88,3 @@ jobs:
if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request' }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

release:
name: Create/Update Release Pull Request
if: github.ref == 'refs/heads/master'
needs: [commit-lint, lint, unit-tests]
runs-on: ubuntu-latest
steps:
- name: Release Please
id: release
uses: GoogleCloudPlatform/release-please-action@v2.20.1
with:
changelog-types: '[ { "type": "feat", "section": "Features", "hidden": false }, { "type": "fix", "section": "Bug Fixes", "hidden": false }, { "type": "build", "section": "Dependencies", "hidden": false }, { "type": "chore", "section": "Miscellaneous", "hidden": false }, { "type": "ci", "section": "Miscellaneous", "hidden": false }, { "type": "perf", "section": "Performance", "hidden": false }, { "type": "refactor", "section": "Miscellaneous", "hidden": false }, { "type": "style", "section": "Miscellaneous", "hidden": false }, { "type": "docs", "section": "Documentation", "hidden": false }]'
release-type: node

0 comments on commit 2f92f5e

Please sign in to comment.