Create dependabot.yml #4
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: Docker Image CI | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Git Semantic Version | |
uses: PaulHatch/[email protected] | |
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 }} | |
DOCKER_REPOSITORY: ${{ secrets.DOCKER_REPOSITORY }} | |
DOCKER_USER: ${{ secrets.DOCKER_USER }} | |
run: | | |
docker build -f Dockerfile.prod -t $DOCKER_USER/$DOCKER_REPOSITORY:$NEW_VERSION . | |
docker tag $DOCKER_USER/$DOCKER_REPOSITORY:$NEW_VERSION $DOCKER_USER/$DOCKER_REPOSITORY:latest | |
- name: Push Docker Image | |
env: | |
NEW_VERSION: ${{ steps.version.outputs.version }} | |
DOCKER_REPOSITORY: ${{ secrets.DOCKER_REPOSITORY }} | |
DOCKER_USER: ${{ secrets.DOCKER_USER }} | |
run: | | |
docker push $DOCKER_USER/$DOCKER_REPOSITORY:$NEW_VERSION | |
docker push $DOCKER_USER/$DOCKER_REPOSITORY:latest | |