Continuous deployment to Google Cloud Run using GitHub Actions - Part 4 - Deploy a Python service

How to deploy your code to Google Cloud Run every time you push changes to GitHub using GitHub actions.
✅ Subscribe for more videos like this one
🔔 Click on the bell icon to be notified when I release a new video
👍 Please like my video!
⚠️ Join my channel to get access to perks: / @federicotartarini
🙏 Support my channel on Patreon at / federicotartarini
☕ Support my channel by buying me a coffee - www.buymeacoffee.com/FedericoT
🎥 Playlists you may find useful:
➜ Google Cloud Platform:
• Google Cloud Console
➜ Beamer LaTeX course:
• LaTeX Beamer
➜ Full LaTeX course:
• LaTeX
➜ PyCharm course:
• PyCharm
➜ Building a documentation website with Docusaurus:
• Docusaurus
🎥 Videos you may find useful:
➜ Build and deploy a documentation website using Docusaurus 2: • Build and deploy a doc...
➜ Add a glossary to your document containing terms and acronyms: • Add a glossary to your...
➜ Write a paper using the Elsevier template: • How to Get Started and...
➜ Overleaf and GitHub integration: • Overleaf and GitHub in...
➜ Review a document in Overleaf: • Review a document in O...
➜ Export citations from Mendeley into LaTeX: • Export citations from ...
➜ Pandas DataFrame to LaTeX table: • Pandas DataFrame to La...
➜ How to use git and GitHub with PyCharm: • How to use git and Git...
➜ Use Grammarly in Overleaf ✍️: • Use Grammarly in Overl...
➜ TeXiFy - PyCharm IntelliJ LaTeX plug-in: • TeXiFy - PyCharm Intel...
➜ Nomenclature in LaTeX document: • Nomenclature in LaTeX ...
➜ Why you should start using LaTeX now!!: • 10 Reasons Why You Sho...
✅ Let's connect:
🌍 My website - federicotartarini.github.io/
💻 GitHub - github.com/FedericoTartarini
Twitter - / federicotartar1
LinkedIn - / federico-tartarini
📝 Useful notes:
👨‍💻 Source code:
github.com/FedericoTartarini/...
🎥 Content of this video:
00:00 - What you will learn
01:00 - Prerequisites
02:00 - Create a simple Flask application
04:20 - Create a GitHub repo and push local changes
05:30 - Deploy the application to Google Cloud Run
08:30 - Create IAM service account
13:30 - Create yml GitHub action file
17:30 - Add secrets to GitHub
20:00 - Trigger Action only if commit message contains some specific text
🔣 Keywords:
#GoogleCloudPlatform #GitHubActions #CloudRun #ContinuousDeployment #GitHub #GoogleCloud #devops

Пікірлер: 31

  • @FedericoTartarini
    @FedericoTartarini2 жыл бұрын

    Some things have changed recently and the yaml code is no longer working. Please replace the code in the .yml file with the following code. Please edit the text in upper case. # .github/workflows/deploy.yml name: Deploy 🚀 Clima to Google Cloud Run (☁🏃) on: push: branches: - main jobs: deploy: name: Deploying 🚀 Clima runs-on: ubuntu-latest if: "contains(github.event.head_commit.message, 'bump version')" steps: - name: Checkout uses: actions/checkout@v2 # Build and push image to Google Container Registry - name: Setting up uses: google-github-actions/setup-gcloud@master with: version: '286.0.0' service_account_key: ${{ secrets.GCP_SA_KEY_JSON }} service_account_email: "YOUR_EMAIL" project_id: YOUR_PROJECT_ID - name: Building (🏗) run: |- gcloud builds submit \ --tag gcr.io/YOUR_PROJECT_ID/SERVICE_ID # Setup gcloud CLI - name: Deploy (🚀) uses: google-github-actions/deploy-cloudrun@main with: service: SERVICE_ID image: gcr.io/YOUR_PROJECT_ID/SERVICE_ID region: REGION credentials: ${{ secrets.GCP_SA_KEY_JSON }} project_id: YOUR_PROJECT_ID

  • Жыл бұрын

    Hello Federico, I'm trying to change the original file with this new that you have provided in comment but I can't find what is the SERVICE_ID. What does SERVICE_ID refers to on GCP? Is it the service id under the Service accounts where we created permissions for Github? Thank you in advance.

  • @FedericoTartarini

    @FedericoTartarini

    Жыл бұрын

    Service_id is the name of the application you deployed

  • @jobiquirobi123
    @jobiquirobi1232 жыл бұрын

    This is one of the best tutorials on GCP that I have found. Congratulations!, It helped me a lot!

  • @FedericoTartarini

    @FedericoTartarini

    2 жыл бұрын

    Thank you so much for sharing your feedback. It means a lot to me.

  • @Hassibayub
    @Hassibayub Жыл бұрын

    Perfectly to the point, no fuss!!

  • @FedericoTartarini

    @FedericoTartarini

    Жыл бұрын

    Thank you.

  • @vanchien5874
    @vanchien58742 жыл бұрын

    Thanks mate, the video is what I am looking for. Great tutorials.

  • @FedericoTartarini

    @FedericoTartarini

    2 жыл бұрын

    I am glad it was useful. Please share it with other people may find it helpful. Have a great day.

  • @simonetii
    @simonetii2 жыл бұрын

    Tante grazie Federico, that's very cool. Greetings

  • @FedericoTartarini

    @FedericoTartarini

    2 жыл бұрын

    I am glad you liked it. Thank you for leaving a comment

  • @razinsyakib
    @razinsyakib5 ай бұрын

    Thankyou very much!!!

  • @FedericoTartarini

    @FedericoTartarini

    5 ай бұрын

    You're welcome!

  • @ThDaViDs07
    @ThDaViDs072 жыл бұрын

    Thank you, do you know the way to downlod a file from cloud storage to github action? I plan to download de dockerfile and applications.properties dinamically by branch.

  • @FedericoTartarini

    @FedericoTartarini

    2 жыл бұрын

    Hi, why don't you keep those files synced in the GitHub repository. Why are you planning to save them in cloud storage?

  • @uivideos
    @uivideos2 жыл бұрын

    hey mate. thanks for the great video :) do you know how to create and pass through .env[prod | dev | uat] vars from actions while depploying?

  • @FedericoTartarini

    @FedericoTartarini

    2 жыл бұрын

    Unfortunately I never looked into that so I cannot help you. Sorry.

  • @thanigaivelk2112
    @thanigaivelk2112 Жыл бұрын

    Great Video. But how to automatically change the version each time I deploy?

  • @FedericoTartarini

    @FedericoTartarini

    Жыл бұрын

    You can use the package bumpversion2

  • @tyler07830
    @tyler07830 Жыл бұрын

    Hi. When I am trying to do "gcloud builds submit" I'm getting this error: "gcloud crashed (UnicodeDecodeError): 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte". Any ideas?

  • @FedericoTartarini

    @FedericoTartarini

    Жыл бұрын

    Have you followed all the steps as shown in the video?

  • @tyler07830

    @tyler07830

    Жыл бұрын

    @@FedericoTartarini Yes. There was a problem with Google Cloud SDK Python Library Encoding. I debugged it and removed a "UTF-8 Encoding" variable in some file, and now its working.. It took me 3 damn days 😂 Thank you for the video btw, you have a nice way of explaining things!

  • @FedericoTartarini

    @FedericoTartarini

    Жыл бұрын

    I am very happy to hear that everything is working now and you found a solution to the problem. Thank you so much for the feedback, I truly appreciate comments from my viewers.

  • @user-fb5ll4ld4d
    @user-fb5ll4ld4d Жыл бұрын

    There is no README file into github. Do you have the commands? Thanks

  • @FedericoTartarini

    @FedericoTartarini

    Жыл бұрын

    No sorry, apologies for that. I made the video a long time ago and I no longer have them.

  • @depenz
    @depenz2 жыл бұрын

    You can do all of this by the web browser within Cloud Run.

  • @FedericoTartarini

    @FedericoTartarini

    2 жыл бұрын

    Yes you are right but I would rather work locally, I find it more convenient.

  • @pr0mming
    @pr0mming Жыл бұрын

    This is a nice video, but is possible someone gets similar error like "Unable to resolve action `google-github-actions/setup-gcloud@master`, unable to find version `master`" in this case has works for me changed the "uses" field line to google-github-actions/setup-gcloud@v0

  • @FedericoTartarini

    @FedericoTartarini

    Жыл бұрын

    The error is cause by the fact that the developers of the GitHub action have changed the location of their source code. You should be able to find the solution with a Google Search.

  • @disrael2101
    @disrael21012 жыл бұрын

    it's not clear unforutenly.. u should add some edits and go slower and more explantion.. u jump from one place to another and cant follow

  • @disrael2101
    @disrael21012 жыл бұрын

    its very important topic to address but the vid isn't clear at all for beginners no explanation and just going from thing to thing