Skip to content

Update docker.yml

Update docker.yml #10

Workflow file for this run

name: docker-arm64
on:
push:
branches:
- "*"
tags:
- v*
pull_request:
env:
DOCKER_DATABASE_IMAGE_NAME: data-catalog-db
IMAGE_NAME: data-catalog
#variables related with the repository
REPOSITORY_MAIN_BRANCH: "master"
#variables related with the docker imager registry
DOCKER_IMAGE_REPOSITORY: mintproject
DOCKER_IMAGE_NAME: data-catalog
DOCKER_FILE: "Dockerfile"
jobs:
build:
strategy:
matrix:
architecture: [arm64]
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- name: Get branch name
id: branch-name
uses: tj-actions/branch-names@v6
- uses: actions/checkout@v2
- name: Create environment variable with the commit id
run: |
echo "DOCKER_TAG=${GITHUB_SHA}" >> $GITHUB_ENV
- name: Expose the commit id
id: exposeValue
run: |
echo "::set-output name=docker_tag::${{ env.DOCKER_TAG }}"
- name: enable qemu
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: API Build and push Docker image
uses: docker/[email protected]
with:
push: true
context: api
tags: ${{ env.DOCKER_IMAGE_REPOSITORY }}/${{ env.DOCKER_IMAGE_NAME }}:${{ steps.branch-name.outputs.current_branch }}, ${{ env.DOCKER_IMAGE_REPOSITORY }}/${{ env.DOCKER_IMAGE_NAME }}:${{ env.DOCKER_TAG }}
build-args: |
MAPGL_ACCESS_TOKEN=${{ secrets.MAPGL_ACCESS_TOKEN }}
platforms: linux/${{ matrix.architecture}}
- name: API Running on the default branch.
if: steps.branch-name.outputs.is_default == 'true'
uses: docker/[email protected]
with:
push: true
context: api
tags: ${{ env.DOCKER_IMAGE_REPOSITORY }}/${{ env.DOCKER_IMAGE_NAME }}:latest
build-args: |
MAPGL_ACCESS_TOKEN: ${{ secrets.MAPGL_ACCESS_TOKEN }}
platforms: linux/${{ matrix.architecture}}
- name: Database Build and push Docker image
uses: docker/[email protected]
with:
push: true
context: postgres
tags: ${{ env.DOCKER_IMAGE_REPOSITORY }}/${{ env.DOCKER_DATABASE_IMAGE_NAME }}:${{ steps.branch-name.outputs.current_branch }}, ${{ env.DOCKER_IMAGE_REPOSITORY }}/${{ env.DOCKER_DATABASE_IMAGE_NAME }}:${{ env.DOCKER_TAG }}
platforms: linux/${{ matrix.architecture}}
- name: Database Running on the default branch.
if: steps.branch-name.outputs.is_default == 'true'
uses: docker/[email protected]
with:
push: true
context: postgres
tags: ${{ env.DOCKER_IMAGE_REPOSITORY }}/${{ env.DOCKER_DATABASE_IMAGE_NAME }}:latest
platforms: linux/${{ matrix.architecture}}