How to make an object pulse continuously?

Hello, I was designing the menu for my game and wanted to make a text box pulse slowly, so it gets bigger to a set size and then shrinks back to it’s original size and repeats this process over and over infinitely.
How do I do it?

Attach this to a text object and see how it works. You can do this a few different ways, and I’m sure there’s a clever use of PingPong to make this into 1-line.

Demo: Imgur: The magic of the Internet

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class GrowAndShrink : MonoBehaviour {

	// Grow parameters
	public float approachSpeed = 0.02f;
	public float growthBound = 2f;
	public float shrinkBound = 0.5f;
	private float currentRatio = 1;

	// The text object we're trying to manipulate
	private Text text;
	private float originalFontSize;

	// And something to do the manipulating
	private Coroutine routine;
	private bool keepGoing = true;
	private bool closeEnough = false;

	// Attach the coroutine
	void Awake () 
	{
		// Find the text  element we want to use
		this.text = this.gameObject.GetComponent<Text>();

		// Then start the routine
		this.routine = StartCoroutine(this.Pulse());
	}

	IEnumerator Pulse()
	{
		// Run this indefinitely
		while (keepGoing)
		{
			// Get bigger for a few seconds
			while (this.currentRatio != this.growthBound)
			{
				// Determine the new ratio to use
				currentRatio = Mathf.MoveTowards( currentRatio, growthBound, approachSpeed);

				// Update our text element
				this.text.transform.localScale = Vector3.one * currentRatio;
				this.text.text = "Growing!";

				yield return new WaitForEndOfFrame();
			}

			// Shrink for a few seconds
			while (this.currentRatio != this.shrinkBound)
			{
				// Determine the new ratio to use
				currentRatio = Mathf.MoveTowards( currentRatio, shrinkBound, approachSpeed);

				// Update our text element
				this.text.transform.localScale = Vector3.one * currentRatio;
				this.text.text = "Shrinking!";

				yield return new WaitForEndOfFrame();
			}
		}
	}
}

Thanks for the quick reply!! I eventually used DOTween, looked a bit cleaner.

public class BtnPulse : MonoBehaviour {

// Use this for initialization
void Start () {
	
	StartAnimation ();

	
}

// Update is called once per frame
void Update () {
	
}

public void StartAnimation() {

	transform.DOScale(0.7f, 0.4f).SetLoops(-1, LoopType.Yoyo);

}

public void StopAnimation() {

	DOTween.Kill (transform);

}

}

@Treyh

Can I use this Script for a gameObject? I would like to scale a gameObject that has a sprite(button) and text. Thanks @TreyH