Skip to content

Commit

Permalink
ci: fix release and added deploy workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jmjuanes committed Jul 28, 2023
1 parent 460a1a6 commit 2f9bacb
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 9 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Deploy
on:
push:
tags: ['*']
workflow_dispatch:

jobs:
deploy:
if: ${{ github.repository == 'jmjuanes/codecake' }}
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
pages: write
id-token: write
# Deploy to github pages env
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# - uses: actions/setup-node@v3
# with:
# node-version: '16.x'
- uses: actions/configure-pages@v1
- uses: actions/upload-pages-artifact@v1
with:
name: github-pages
path: '.'
- uses: actions/deploy-pages@v1
id: deployment
30 changes: 21 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,31 @@
name: "Generate a public release"
name: Release
on:
push:
tags:
- "*"
tags: ['*']

jobs:
npm-release:
name: "Publish in npm"
release:
name: Release
if: ${{ github.repository == 'jmjuanes/codecake' }}
runs-on: ubuntu-latest
## Set permissions to the github token
## https://github.com/softprops/action-gh-release#permissions
permissions:
contents: write
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- uses: softprops/action-gh-release@v1

publish:
name: Publish
if: ${{ github.repository == 'jmjuanes/codecake' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "16.x"
registry-url: "https://registry.npmjs.org"
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 comments on commit 2f9bacb

Please sign in to comment.