Skip to content

Update version

Update version #94

Workflow file for this run

name: Docker
on:
push:
branches:
- master
tags:
- v*
pull_request:
env:
IMAGE_NAME: ib-gateway-docker
jobs:
push:
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- name: Checkout code
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Get version from tag
id: version
run: echo "name=version::$(echo ${GITHUB_REF#refs/tags/})" >> $GITHUB_OUTPUT
- name: Set up semantic versioning
id: semver
uses: paulhatch/[email protected]
with:
bump: patch
version: ${{ steps.version.outputs.version }}
- name: Build Docker image
run: docker build . --file Dockerfile --tag "ghcr.io/${{ github.repository }}/${{ env.IMAGE_NAME }}:${{ steps.semver.outputs.version }}"
- name: Login to GitHub Container Registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Tag and push Docker image
if: github.event_name == 'push'
id: push-image
run: |
docker push "ghcr.io/${{ github.repository }}/${{ env.IMAGE_NAME }}:${{ steps.semver.outputs.version }}"
echo "name=image-url::ghcr.io/${{ github.repository }}/${{ env.IMAGE_NAME }}:${{ steps.semver.outputs.version }}" >> $GITHUB_OUTPUT
echo "name=image-tag::${{ steps.semver.outputs.version }}" >> $GITHUB_OUTPUT