Skip to content

Commit

Permalink
Create docker-image.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
leandrotomassini authored Oct 10, 2023
1 parent bb9f955 commit 4350a5b
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Docker Image CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:

build:

runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Git Semantic Version
uses: PaulHatch/semantic-version@v4.0.3
with:
major_pattern: "major:"
minor_pattern: "feat:"
format: "${major}.${minor}.${patch}-prerelease${increment}"
id: version

- name: Docker Login
env:
DOCKER_USER: ${{ secrets.DOCKER_USER }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}

run: |
docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
- name: Build Docker Image
env:
NEW_VERSION: ${{ steps.version.outputs.version }}
run: |
docker build -t airepublico/innovancebackend:$NEW_VERSION .
docker build -t airepublico/innovancebackend:latest .
- name: Push Docker Image
env:
NEW_VERSION: ${{ steps.version.outputs.version }}
run: |
docker push airepublico/innovancebackend:$NEW_VERSION
docker push airepublico/innovancebackend:latest

0 comments on commit 4350a5b

Please sign in to comment.