Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
GitHub Actions Cookbook

You're reading from   GitHub Actions Cookbook A practical guide to automating repetitive tasks and streamlining your development process

Arrow left icon
Product type Paperback
Published in Apr 2024
Publisher Packt
ISBN-13 9781835468944
Length 250 pages
Edition 1st Edition
Languages
Tools
Concepts
Arrow right icon
Author (1):
Arrow left icon
Michael Kaufmann Michael Kaufmann
Author Profile Icon Michael Kaufmann
Michael Kaufmann
Arrow right icon
View More author details
Toc

Table of Contents (10) Chapters Close

Preface 1. Chapter 1: GitHub Actions Workflows FREE CHAPTER 2. Chapter 2: Authoring and Debugging Workflows 3. Chapter 3: Building GitHub Actions 4. Chapter 4: The Workflow Runtime 5. Chapter 5: Automate Tasks in GitHub with GitHub Actions 6. Chapter 6: Build and Validate Your Code 7. Chapter 7: Release Your Software with GitHub Actions 8. Index 9. Other Books You May Enjoy

Releasing the container application to AKS

Now, it is time to release our application to the production environment in AKS.

Getting ready…

Open the file .github/workflows/publish.yml.

How to do it…

  1. Add two more environment variables to the top of the workflow:
    env:
      REGISTRY: 'ghcr.io'
      IMAGE_NAME: '${{ github.repository }}'
      APP_NAME: 'release-recipe-app'
      SERVICE_NAME: 'release-recipe-service'

    Add an output to the job build-and-push-image from the previous recipe so that the new job will be able to access the image name:

    outputs:
      image_tag: ${{ fromJSON(steps.meta.outputs.json).tags[0] }}
  2. Add a second job called production to the workflow, which only runs on pushes to main and is associated with the production environment. Set the URL of the environment to the output of a step we’ll add later. The job will need the permissions id-token: write and content...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image