Skip to content

improve product history #18

improve product history

improve product history #18

name: Build and Push to Docker Hub
on:
push:
branches:
- develop
- master
jobs:
build-and-push:
runs-on: ubuntu-latest
environment: docker
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set Docker tag
id: set-tag
run: |
if [[ ${{ github.ref }} == 'refs/heads/master' ]]; then
echo "DOCKER_TAG=latest" >> $GITHUB_OUTPUT
else
echo "DOCKER_TAG=develop" >> $GITHUB_OUTPUT
fi
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: akbarsaputrait/ordero-api:${{ steps.set-tag.outputs.DOCKER_TAG }}