Skip to content

updated action

updated action #52

Workflow file for this run

name: ORDAPI DEPLOY CI
on:
push:
branches:
- 'ordapi*'
- 'opi*'
env:
BASE_IMAGE_NAME: crypticmetadev/ordapi
jobs:
build-and-push-backend:
runs-on: ubuntu-latest
env:
BRANCH_NAME: ${{ github.ref_name }}
IMAGE_NAME: crypticmetadev/ordapi:${{ github.ref_name }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build ordapi image
run: |
docker build \
-t ${{ env.IMAGE_NAME }} . \
--build-arg MONGODB_URI=${{ secrets.MONGODB_URI }}
- name: Log in to Docker registry
uses: docker/login-action@v1
with:
username: crypticmetadev
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Push image to Docker registry
run: |
docker push ${{ env.IMAGE_NAME }}