Main pipeline #50
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: Main pipeline | |
on: | |
workflow_run: | |
workflows: [ "Tests" ] | |
branches: | |
types: | |
- completed | |
jobs: | |
# define job to build and publish docker image | |
build-and-push-docker-image-nightly: | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
# run only when code is compiling and tests are passing | |
runs-on: ubuntu-22.04 | |
env: | |
DOCKERHUB_TAG: ${{ github.ref_name }} | |
# steps to perform in job | |
steps: | |
- name: Checkout code | |
uses: actions/[email protected] | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build image and push backend | |
uses: docker/build-push-action@v3 | |
with: | |
# relative path to the place where source code with Dockerfile is located | |
file: ./Dockerfile.api | |
push: ${{ github.ref == 'refs/heads/main' }} | |
tags: ${{secrets.DOCKERHUB_USERNAME}}/api:${{ env.DOCKERHUB_TAG }} | |
- name: Build image and push database | |
uses: docker/build-push-action@v3 | |
with: | |
# relative path to the place where source code with Dockerfile is located | |
file: ./Dockerfile.db | |
push: ${{ github.ref == 'refs/heads/main' }} | |
tags: ${{secrets.DOCKERHUB_USERNAME}}/database:${{ env.DOCKERHUB_TAG }} | |
- name: Build image and push httpd | |
uses: docker/build-push-action@v3 | |
with: | |
# relative path to the place where source code with Dockerfile is located | |
file: ./Dockerfile.http | |
push: ${{ github.ref == 'refs/heads/main' }} | |
tags: ${{secrets.DOCKERHUB_USERNAME}}/httpd:${{ env.DOCKERHUB_TAG }} | |
- name: Build image and push front | |
uses: docker/build-push-action@v3 | |
with: | |
# relative path to the place where source code with Dockerfile is located | |
context: ./front | |
file: ./front/Dockerfile | |
push: ${{ github.ref == 'refs/heads/main' }} | |
tags: ${{secrets.DOCKERHUB_USERNAME}}/front:${{ env.DOCKERHUB_TAG }} |