Release workoutrecorder-backend image #6
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: Release workoutrecorder-backend image | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'App version to release' | |
required: true | |
default: '1.0.0' | |
jobs: | |
release: | |
name: Release workoutrecorder-backend image | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup Maven Action | |
uses: s4u/setup-maven-action@v1.2.1 | |
with: | |
java-version: 11 | |
maven-version: 3.8.2 | |
- name: Update pom.xml and Dockerfile | |
run: | | |
version=${{ github.event.inputs.version }} | |
sed -i "s/app-version/$version/g" pom.xml Dockerfile | |
- name: Build and Package | |
run: mvn clean package | |
- name: Login to Github container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: ./Dockerfile | |
push: true | |
tags: ghcr.io/red-devops/workoutrecorder-backend:${{ github.event.inputs.version }} |