Create Release #18
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: Create Release | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Version' | |
required: true | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Publish Docker image to Registry | |
uses: elgohr/Publish-Docker-Github-Action@v5 | |
with: | |
name: sitapati/zbctl | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
dockerfile: Dockerfile | |
tags: "${{ inputs.version }}, latest" | |
tag-and-publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16.17.0 | |
cache: 'npm' | |
- name: Install | |
run: npm ci --ignore-scripts | |
- name: Set version | |
run: | | |
git config user.name 'github-actions[bot]' | |
git config user.email 'github-actions[bot]@users.noreply.github.com' | |
npm version ${{ inputs.version }} -m "Publish v%s" | |
- name: Publish to NPM | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
run: npm publish --access=public | |
- name: Push changes | |
run: git push --follow-tags |