Skip to content

cloud run

cloud run #2

Workflow file for this run

name: Build and Push Docker Image
on:
push:
branches:
- main
- dev
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check Out Repo
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set Tag
run: |
if [[ $GITHUB_REF == 'refs/heads/main' ]]; then
echo "TAG=latest" >> $GITHUB_ENV
elif [[ $GITHUB_REF == 'refs/heads/dev' ]]; then
echo "TAG=dev" >> $GITHUB_ENV
fi
- name: Build and Push Docker Image
uses: docker/build-push-action@v2
with:
context: ./web-app
file: ./web-app/Dockerfile
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/web3-testimonials:${{ env.TAG }}
- name: Logout from DockerHub
run: docker logout