<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Brian Shaw</title>
    <description>The latest articles on DEV Community by Brian Shaw (@bshaw).</description>
    <link>https://dev.to/bshaw</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F10481%2Fb4d0afd4-d249-4edf-9ee1-e632b0c07250.jpg</url>
      <title>DEV Community: Brian Shaw</title>
      <link>https://dev.to/bshaw</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/bshaw"/>
    <language>en</language>
    <item>
      <title>My submission to the GitHub Actions x DEV Hackathon | Automatic upload to Google Cloud Storage with GitHub Actions</title>
      <dc:creator>Brian Shaw</dc:creator>
      <pubDate>Thu, 20 Aug 2020 14:29:55 +0000</pubDate>
      <link>https://dev.to/bshaw/my-submission-to-the-github-actions-x-dev-hackathon-automatic-upload-to-google-cloud-storage-with-github-actions-4886</link>
      <guid>https://dev.to/bshaw/my-submission-to-the-github-actions-x-dev-hackathon-automatic-upload-to-google-cloud-storage-with-github-actions-4886</guid>
      <description>&lt;h3&gt;
  
  
  My Workflow
&lt;/h3&gt;

&lt;p&gt;This workflow uploads files to Google Cloud Storage. I use it for uploading my static personal web site, which is hosted from Cloud Storage, but it could be adapted for any use case. Simple modifications could make it work for other providers, too...&lt;/p&gt;

&lt;h3&gt;
  
  
  Submission Category:
&lt;/h3&gt;

&lt;p&gt;DIY Deployments&lt;/p&gt;

&lt;h3&gt;
  
  
  Yaml File or Link to Code
&lt;/h3&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/bshaw" rel="noopener noreferrer"&gt;
        bshaw
      &lt;/a&gt; / &lt;a href="https://github.com/bshaw/sha.ws" rel="noopener noreferrer"&gt;
        sha.ws
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;sha.ws&lt;/h1&gt;

&lt;/div&gt;
&lt;p&gt;&lt;a href="https://github.com/bshaw/sha.ws/actions/workflows/pages.yml" rel="noopener noreferrer"&gt;&lt;img src="https://github.com/bshaw/sha.ws/actions/workflows/pages.yml/badge.svg" alt="Build and deploy static content to Pages"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;A personal website built with &lt;a href="https://gohugo.io" rel="nofollow noopener noreferrer"&gt;Hugo&lt;/a&gt; and the &lt;a href="https://jpanther.github.io/congo/" rel="nofollow noopener noreferrer"&gt;Congo theme&lt;/a&gt;.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Content License&lt;/h2&gt;

&lt;/div&gt;
&lt;p&gt;&lt;a href="http://creativecommons.org/licenses/by/4.0/" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/5d664d38d568b3aff86b402e88c103a392194dba23100230a329ee81f61d89a6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d43432532304259253230342e302d6c69676874677265792e737667" alt="CC BY 4.0"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Site content licensed under a &lt;a href="http://creativecommons.org/licenses/by/4.0/" rel="nofollow noopener noreferrer"&gt;Creative Commons Attribution 4.0 International
License&lt;/a&gt;, except where indicated otherwise.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://creativecommons.org/licenses/by/4.0/" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/378f603d990dc28fffb37a14fda1a9242bc7828411ffad53782feaf21c65e51c/68747470733a2f2f692e6372656174697665636f6d6d6f6e732e6f72672f6c2f62792f342e302f38387833312e706e67" alt="CC BY 4.0"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;



&lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/bshaw/sha.ws" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


&lt;h3&gt;
  
  
  Additional Resources / Info
&lt;/h3&gt;

&lt;p&gt;I posted about this recently, so why not submit it!?&lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="/bshaw" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F10481%2Fb4d0afd4-d249-4edf-9ee1-e632b0c07250.jpg" alt="bshaw"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/bshaw/automatic-upload-to-google-cloud-storage-with-github-actions-mj0" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Automatic upload to Google Cloud Storage with GitHub Actions&lt;/h2&gt;
      &lt;h3&gt;Brian Shaw ・ Jun 24 '20&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#cloud&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#devops&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#googlecloud&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#githubactions&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


</description>
      <category>actionshackathon</category>
      <category>github</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Run the .NET Core SDK and Runtime from a Docker container</title>
      <dc:creator>Brian Shaw</dc:creator>
      <pubDate>Wed, 08 Jul 2020 21:04:23 +0000</pubDate>
      <link>https://dev.to/bshaw/run-the-net-core-sdk-and-runtime-from-a-docker-container-416</link>
      <guid>https://dev.to/bshaw/run-the-net-core-sdk-and-runtime-from-a-docker-container-416</guid>
      <description>&lt;h2&gt;
  
  
  Overview
&lt;/h2&gt;

&lt;p&gt;I run a lot of my tooling straight from Docker containers instead of installing them on my system.&lt;br&gt;
Doing so helps me ensure I'm using the desired version(s) straight from the official maintainers, helps me keep my system tidy, and guarantees a consistent environment across machines.&lt;/p&gt;

&lt;p&gt;I've started getting my feet wet with .NET Core in preparation for an upcoming project and noticed that neither Microsoft's documentation nor their &lt;a href="https://hub.docker.com/_/microsoft-dotnet-core"&gt;Docker Hub page for .NET Core&lt;/a&gt; mention running the SDK or runtimes straight from the published images, so I've put together a simple wrapper to run the .NET Core SDK and Runtime from a Docker container:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/bshaw/dotnet-docker/"&gt;https://github.com/bshaw/dotnet-docker/&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The script uses the official &lt;a href="https://hub.docker.com/_/microsoft-dotnet-core-sdk/"&gt;Microsoft .NET Core SDK image&lt;/a&gt; using the &lt;code&gt;3.1&lt;/code&gt; tag (Debian 10).&lt;br&gt;
It is based on (effectively forked from) the Docker Compose &lt;a href="https://github.com/docker/compose/blob/1.25.4/script/run/run.sh"&gt;Run docker-compose in a container&lt;/a&gt; script, which properly handles volume mappings and various options based on the environment.&lt;/p&gt;
&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;

&lt;p&gt;Place the wrapper script in your path and made it executable:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;curl &lt;span class="nt"&gt;-L&lt;/span&gt; &lt;span class="nt"&gt;--fail&lt;/span&gt; https://raw.githubusercontent.com/bshaw/dotnet-docker/master/run.sh &lt;span class="nt"&gt;-o&lt;/span&gt; /usr/local/bin/dotnet
&lt;span class="nb"&gt;sudo chmod&lt;/span&gt; +x /usr/local/bin/dotnet
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  Usage
&lt;/h2&gt;

&lt;p&gt;Use the dotnet command as you would if it were installed locally:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;❯ dotnet &lt;span class="nt"&gt;--info&lt;/span&gt;
.NET Core SDK &lt;span class="o"&gt;(&lt;/span&gt;reflecting any global.json&lt;span class="o"&gt;)&lt;/span&gt;:
 Version:   3.1.301
 Commit:    7feb845744

Runtime Environment:
 OS Name:     debian
 OS Version:  10
 OS Platform: Linux
 RID:         debian.10-x64
 Base Path:   /usr/share/dotnet/sdk/3.1.301/

Host &lt;span class="o"&gt;(&lt;/span&gt;useful &lt;span class="k"&gt;for &lt;/span&gt;support&lt;span class="o"&gt;)&lt;/span&gt;:
  Version: 3.1.5
  Commit:  65cd789777

.NET Core SDKs installed:
  3.1.301 &lt;span class="o"&gt;[&lt;/span&gt;/usr/share/dotnet/sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.App 3.1.5 &lt;span class="o"&gt;[&lt;/span&gt;/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.1.5 &lt;span class="o"&gt;[&lt;/span&gt;/usr/share/dotnet/shared/Microsoft.NETCore.App]

To &lt;span class="nb"&gt;install &lt;/span&gt;additional .NET Core runtimes or SDKs:
  https://aka.ms/dotnet-download
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h3&gt;
  
  
  TODO: Multi version support
&lt;/h3&gt;

&lt;p&gt;The dotnet version is specified as a variable in the script - you can easily update the file on your system depending on your requirements.&lt;br&gt;
I may also update the script to support multiple versions.&lt;br&gt;
Feel free to send a pull request if you get to it before I do.&lt;/p&gt;

</description>
      <category>dotnet</category>
      <category>docker</category>
    </item>
    <item>
      <title>Automatic upload to Google Cloud Storage with GitHub Actions</title>
      <dc:creator>Brian Shaw</dc:creator>
      <pubDate>Wed, 24 Jun 2020 11:47:30 +0000</pubDate>
      <link>https://dev.to/bshaw/automatic-upload-to-google-cloud-storage-with-github-actions-mj0</link>
      <guid>https://dev.to/bshaw/automatic-upload-to-google-cloud-storage-with-github-actions-mj0</guid>
      <description>&lt;h2&gt;
  
  
  Overview
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/features/actions"&gt;GitHub Actions&lt;/a&gt; enable simple workflow automation and CI/CD right from GitHub repos.&lt;/p&gt;

&lt;p&gt;Uploading your content, whether a static website or any other artifact can be easily managed with an Actions workflow.&lt;/p&gt;

&lt;p&gt;This article walks through everything required to successfully set up your workflow.&lt;/p&gt;

&lt;p&gt;The examples are based on the &lt;em&gt;this&lt;/em&gt; static website (&lt;a href="https://sha.ws"&gt;sha.ws&lt;/a&gt;), which is uploaded to Google Cloud Storage for hosting.&lt;br&gt;
The workflow is available in the git repo for the site: &lt;a href="https://github.com/bshaw/sha.ws/blob/master/.github/workflows/google-cloud-storage.yml"&gt;https://github.com/bshaw/sha.ws/blob/master/.github/workflows/google-cloud-storage.yml&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; &lt;em&gt;Most&lt;/em&gt; of these instructions use the GCP web console - you can just as easily use gcloud cli or your favourite language.&lt;/p&gt;
&lt;h2&gt;
  
  
  Role
&lt;/h2&gt;

&lt;p&gt;We will be giving the GitHub Actions workflow runner access to our GCP project, so we must ensure to use a role which has only the absolutely necessary privileges.&lt;/p&gt;
&lt;h3&gt;
  
  
  Create a new role
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Navigate to: &lt;code&gt;IAM &amp;amp; Admin &amp;gt; Roles &amp;gt; +Create Role&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Enter a title for the role - I like to preface custom roles with &lt;code&gt;Custom -&lt;/code&gt; so they're easy to list later on&lt;/li&gt;
&lt;li&gt;(Optional) Enter a description&lt;/li&gt;
&lt;li&gt;Set &lt;code&gt;Role launch stage&lt;/code&gt; to &lt;code&gt;General Availability&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Assign permissions:&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;* resourcemanager.projects.get
* storage.buckets.get
* storage.buckets.list
* storage.objects.create
* storage.objects.delete
* storage.objects.get
* storage.objects.list
* storage.objects.update
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;See the GCP documentation for &lt;a href="https://cloud.google.com/iam/docs/creating-custom-roles"&gt;Creating and managing custom roles&lt;/a&gt; for more details.&lt;/p&gt;
&lt;h2&gt;
  
  
  Service Account
&lt;/h2&gt;

&lt;p&gt;A service account with the previously created rule will be used by the workflow to connect to Cloud Storage and upload files.&lt;/p&gt;
&lt;h3&gt;
  
  
  Create a new service account
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Navigate to: IAM &amp;amp; Admin &amp;gt; Service Accounts &amp;gt; +Create Service Account&lt;/li&gt;
&lt;li&gt;Enter a name for the account - I like to preface service accounts with &lt;code&gt;sa -&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Accept the recommended service account id&lt;/li&gt;
&lt;li&gt;(Optional) Enter a description&lt;/li&gt;
&lt;li&gt;Click Create&lt;/li&gt;
&lt;li&gt;On the second page, select the custom role created in the previous step - this will assign permissions to the account&lt;/li&gt;
&lt;li&gt;Select all other defaults to finish creating the account&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;See the GCP documentation page for &lt;a href="https://cloud.google.com/iam/docs/creating-managing-service-accounts"&gt;Creating and managing service accounts&lt;/a&gt; for more details.&lt;/p&gt;
&lt;h3&gt;
  
  
  Create a service account key
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; We will use the gcloud cli for this step even though the rest of the examples use the web console.&lt;br&gt;
A key created in the console differs slightly from one created with gcloud - since our workflow uses gcloud, we need a correctly formatted key.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;gcloud iam service-accounts keys create ~/key.json &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--iam-account&lt;/span&gt; sa-name@project-id.iam.gserviceaccount.com
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The key file will be created at &lt;code&gt;~/key.json&lt;/code&gt;.&lt;br&gt;
&lt;strong&gt;Keep this file private - do no not store it in your repo - it contains everything needed to authenticate to your GCP project as the service account user.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;See the GCP documentation page for &lt;a href="https://cloud.google.com/iam/docs/creating-managing-service-account-keys#iam-service-account-keys-create-gcloud"&gt;Creating and managing service account keys&lt;/a&gt; for more details.&lt;/p&gt;
&lt;h3&gt;
  
  
  Secrets
&lt;/h3&gt;

&lt;p&gt;The workflow uses the &lt;code&gt;gsutil&lt;/code&gt; command line utility (included with gcloud) to interact to Cloud Storage.&lt;br&gt;
gsutil needs the project, service account key, and Cloud Storage bucket supplied in order to connect and manage files.&lt;br&gt;
We will store these as secrets in our GitHub repo and access them as variables in the workflow.&lt;/p&gt;
&lt;h4&gt;
  
  
  GCS_PROJECT
&lt;/h4&gt;

&lt;p&gt;The name of the CGP project containing the Cloud Storage Bucket.&lt;/p&gt;
&lt;h4&gt;
  
  
  GCS_BUCKET
&lt;/h4&gt;

&lt;p&gt;The name of the Cloud Storage bucket to deploy the site.&lt;/p&gt;
&lt;h4&gt;
  
  
  GCS_SA_KEY
&lt;/h4&gt;

&lt;p&gt;The base64 encoded authentication key for the service account.&lt;/p&gt;

&lt;p&gt;Base64 encode the key:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; ~/key.json |base64
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;See the GitHub documentation page for &lt;a href="https://help.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets"&gt;Creating and storing encrypted secrets&lt;/a&gt; for more details.&lt;/p&gt;

&lt;h2&gt;
  
  
  Workflow
&lt;/h2&gt;

&lt;p&gt;The workflow is created in your repo at &lt;code&gt;.github/workflows/workflow.yml&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Google provides some actions which can be imported to simplify your workflow, as well as some good examples in their &lt;a href="https://github.com/GoogleCloudPlatform/github-actions"&gt;github-actions&lt;/a&gt; repo.&lt;/p&gt;

&lt;h3&gt;
  
  
  Trigger the workflow
&lt;/h3&gt;

&lt;p&gt;Since my workflow is for a personal website, I trigger when I push to master:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;push&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;branches&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;master&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h3&gt;
  
  
  Set environment variables for the workflow runner
&lt;/h3&gt;

&lt;p&gt;You can set environment variables for the workflow runner to use when it runs steps.&lt;br&gt;
In this example we pull in the Cloud Storage bucket name from our GitHub secrets:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;env&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;GCS_BUCKET&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.GCS_BUCKET }}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h3&gt;
  
  
  Install and configure gcloud (and gsutil)
&lt;/h3&gt;

&lt;p&gt;Use the &lt;a href="https://github.com/GoogleCloudPlatform/github-actions/tree/master/setup-gcloud"&gt;setup-gcloud&lt;/a&gt; action to install and configure the gcloud and gsutil command line tools.&lt;br&gt;
Notice how we pull in the service account key and project id from our secrets:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Checkout&lt;/span&gt;
    &lt;span class="s"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v2&lt;/span&gt;

&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Setup - gcloud / gsutil&lt;/span&gt;
  &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;GoogleCloudPlatform/github-actions/setup-gcloud@master&lt;/span&gt;
  &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;service_account_key&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.GCS_SA_KEY }}&lt;/span&gt;
    &lt;span class="na"&gt;project_id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.GCS_PROJECT }}&lt;/span&gt;
    &lt;span class="na"&gt;export_default_credentials&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="no"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h3&gt;
  
  
  Upload to Cloud Storage
&lt;/h3&gt;

&lt;p&gt;Use the gsutil command line to upload your files to the Cloud Storage bucket.&lt;br&gt;
In this example, we are uploading the generated static website, stored in the &lt;code&gt;content&lt;/code&gt; subdirectory - specify whatever source path you require.&lt;br&gt;
Notice how we pull in the bucket name from the environment variable we created in the workflow:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Deploy&lt;/span&gt;
  &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|-&lt;/span&gt;
    &lt;span class="s"&gt;gsutil -m rsync -R output gs://$GCS_BUCKET&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h3&gt;
  
  
  Run workflow and check status
&lt;/h3&gt;

&lt;p&gt;The results and output of the workflow can be seen in the &lt;code&gt;/actions&lt;/code&gt; url of your repo in GitHub.&lt;br&gt;
There's also an Actions link at the top of the page (where you select between code, issues, pull requests, etc.).&lt;/p&gt;

&lt;p&gt;This output can be helpful when troubleshooting a broken workflow.&lt;/p&gt;
&lt;h3&gt;
  
  
  Status badge
&lt;/h3&gt;

&lt;p&gt;You can add a workflow status badge to your README.&lt;br&gt;
Simply reference the workflow name (the &lt;code&gt;name&lt;/code&gt; parameter in the workflow yml file) in the badge path:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="p"&gt;![&lt;/span&gt;&lt;span class="nv"&gt;{{alt text}}&lt;/span&gt;&lt;span class="p"&gt;](&lt;/span&gt;&lt;span class="sx"&gt;https://github.com/{{github&lt;/span&gt; user}}/{{github repo}}/workflows/{{workflow%20name}}/badge.svg)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;See the GitHub documentation for &lt;a href="https://help.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow#adding-a-workflow-status-badge-to-your-repository"&gt;Adding a workflow status badge to your repository&lt;/a&gt; for more details.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final thoughts
&lt;/h2&gt;

&lt;p&gt;That's all there is to it!&lt;br&gt;
Despite all of the steps, it probably takes about 10 to 15 minutes to get this configured (plus any trial and error to get the workflow behaving).&lt;/p&gt;

</description>
      <category>cloud</category>
      <category>devops</category>
      <category>googlecloud</category>
      <category>githubactions</category>
    </item>
  </channel>
</rss>
