Merge pull request #33 from tusharlock10/develop #29
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: Production Test & Deploy | |
on: | |
push: | |
branches: | |
- main | |
env: | |
PALADINS_DEV_ID: ${{ secrets.PALADINS_DEV_ID }} | |
PALADINS_API_KEY: ${{ secrets.PALADINS_API_KEY }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
jobs: | |
test: | |
name: "test 🧪" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Install dependencies | |
run: npm ci | |
- name: Build docker image | |
run: npm run test | |
deploy: | |
name: "deploy 🚀" | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v2 | |
- name: Install dependencies | |
run: npm ci | |
- name: Publish package to npm | |
uses: JS-DevTools/npm-publish@v1 | |
with: | |
token: ${{ env.NPM_TOKEN }} | |
create-release: | |
needs: deploy | |
name: "create release 📦" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Get version from package.json | |
id: package-version | |
uses: martinbeentjes/npm-get-version-action@master | |
- name: Bump version and push tag | |
id: tag_version | |
uses: mathieudutour/github-tag-action@v6.0 | |
with: | |
custom_tag: ${{ steps.package-version.outputs.current-version}} | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create a GitHub release | |
uses: ncipollo/release-action@v1 | |
with: | |
tag: ${{ steps.tag_version.outputs.new_tag }} | |
name: Release ${{ steps.tag_version.outputs.new_tag }} | |
bodyFile: CHANGELOG.md |