Merge pull request #72 from samagra-comms/development #20
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 Build | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
docker-build-push: | |
runs-on: ubuntu-20.04 | |
timeout-minutes: 40 | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v3 | |
- name: Extract version from pom.xml | |
id: version | |
run: | | |
echo ::set-output name=VERSION::$(grep -A 1 '<artifactId>orchestrator</artifactId>' pom.xml | grep -oP '(?<=<version>).*?(?=</version>)') | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Log in to Docker Hub | |
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 | |
with: | |
username: ${{secrets.DOCKER_HUB_USERNAME}} | |
password: ${{secrets.DOCKER_HUB_ACCESS_TOKEN}} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v2 | |
with: | |
context: "." | |
push: true | |
tags: samagragovernance/orchestrator:v${{ steps.version.outputs.VERSION }}, samagragovernance/orchestrator:latest | |
build-args: | | |
username=${{ secrets.USERNAME }}, | |
token=${{ secrets.TOKEN }} |