Build and Publish ME TT Data Portal Images (Django APIs & React App) to Quay.io #22
Workflow file for this run
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: Build and Publish ME TT Data Portal Images (Django APIs & React App) to Quay.io | |
on: | |
# push: | |
# branches: | |
# - main | |
# tags: | |
# - 'v*' # Only push semantic version tags, e.g., v1.0.0, v2.1.3, etc. | |
workflow_dispatch: | |
jobs: | |
# Job to build and push Django API image | |
build-and-push-django: | |
runs-on: ubuntu-latest | |
env: | |
IMAGE_TAG: ${{ github.ref_name }} | |
steps: | |
- name: Check out the code | |
uses: actions/checkout@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Log in to Quay.io | |
env: | |
DOCKER_CONFIG_JSON: ${{ secrets.QUAY_DOCKER_CONFIG }} | |
run: | | |
echo "$DOCKER_CONFIG_JSON" > ~/.docker/config.json | |
- name: Build the Django Docker image | |
run: | | |
docker build -t quay.io/microbiome-informatics/mett-dataportal-api:${{ env.IMAGE_TAG }} -f ./dataportal_api/Dockerfile . | |
- name: Push the Django Docker image | |
run: | | |
docker push quay.io/microbiome-informatics/mett-dataportal-api:${{ env.IMAGE_TAG }} | |
# Job to build and push React app image | |
build-and-push-react: | |
runs-on: ubuntu-latest | |
env: | |
IMAGE_TAG: ${{ github.ref_name }} | |
steps: | |
- name: Check out the code | |
uses: actions/checkout@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Log in to Quay.io | |
env: | |
DOCKER_CONFIG_JSON: ${{ secrets.QUAY_DOCKER_CONFIG }} | |
run: | | |
echo "$DOCKER_CONFIG_JSON" > ~/.docker/config.json | |
- name: Build the React Docker image | |
run: | | |
docker build -t quay.io/microbiome-informatics/mett-dataportal-react-app:${{ env.IMAGE_TAG }} -f ./dataportal-app/Dockerfile . | |
- name: Push the React Docker image | |
run: | | |
docker push quay.io/microbiome-informatics/mett-dataportal-react-app:${{ env.IMAGE_TAG }} |