Skip to content

ci: reads version from package.json for github tag #15

ci: reads version from package.json for github tag

ci: reads version from package.json for github tag #15

Workflow file for this run

name: Bump version
on:
push:
branches:
- main
jobs:
release:
runs-on: ubuntu-latest
name: "Bump version and publish docker image"
steps:
- name: Check out
uses: actions/checkout@v3
- name: Version Bump
run: |
npm install -g semantic-release
semantic-release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build Docker Image
env:
POSTGRES_USER: ${{ env.POSTGRES_USER }}
POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD }}
run: |
docker-compose -f docker-compose.yml build
- name: Authenticate to GitHub Container Registry
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin
- name: Push Docker Image to GitHub Packages
run: |
NEW_VERSION=$(node -p "require('./package.json').version")
docker tag inventory:tag ghcr.io/${{ github.repository_owner }}/inventory:${NEW_VERSION}
docker push ghcr.io/${{ github.repository_owner }}/inventory:${NEW_VERSION}
env:
GHCR_PAT: ${{ secrets.GITHUB_TOKEN }}