-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Github Actions deprecation notices (#12)
* Update actions/checkout to version 3.1.0 * Update google-github-actions/auth to version 1.0.0 * Update google-github-actions/setup-gcloud to version v1.0.0 * Fix 'URLEncode Cloud SQL Instance string' step * Fix 'Set build/deploy timestamp' steps * Update google-github-actions/deploy-cloudrun to version 0.10.3 * Specify CPU and memory to cloud run deploy * Fix 'Generate UUID for build' step * Update docker/setup-buildx-action to version 2.2.1 * Update docker/build-push-action to version v3.2.0
- Loading branch information
1 parent
1985cc6
commit afa10f2
Showing
5 changed files
with
33 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,14 @@ on: | |
required: false | ||
type: number | ||
default: 0 | ||
cloud-run-service-cpu-count: | ||
required: false | ||
type: number | ||
default: 1 | ||
cloud-run-service-memory: | ||
required: false | ||
type: string | ||
default: 512Mi | ||
|
||
jobs: | ||
service-deploy: | ||
|
@@ -38,21 +46,21 @@ jobs: | |
steps: | ||
# actions/checkout MUST come before auth | ||
- name: Checkout the code | ||
uses: actions/checkout@v3.0.2 | ||
uses: actions/checkout@v3.1.0 | ||
|
||
- name: Authenticate to Google Cloud | ||
uses: google-github-actions/auth@v0.8.0 | ||
uses: google-github-actions/auth@v1.0.0 | ||
with: | ||
service_account: github-actions-runner@rails-google-cloud-quickstart.iam.gserviceaccount.com | ||
workload_identity_provider: projects/000000000000/locations/global/workloadIdentityPools/devops/providers/github | ||
|
||
- name: Set up Google Cloud SDK | ||
uses: google-github-actions/setup-gcloud@v0.6.0 | ||
uses: google-github-actions/setup-gcloud@v1.0.0 | ||
|
||
- name: URLEncode Cloud SQL Instance string | ||
id: url-encode-cloud-sql-instance | ||
run: |- | ||
ruby -e 'require "erb"; puts "::set-output name=encoded-value::#{ERB::Util.url_encode("${{ inputs.cloud-sql-instance }}")}"' | ||
ruby -e 'require "erb"; puts "encoded-value=#{ERB::Util.url_encode("${{ inputs.cloud-sql-instance }}")}"' >> $GITHUB_OUTPUT | ||
- name: Register Deploy Start on Github | ||
uses: bobheadxi/[email protected] | ||
|
@@ -65,11 +73,11 @@ jobs: | |
|
||
- name: Set deploy timestamp | ||
id: set-deploy-timestamp | ||
run: echo "::set-output name=timestamp::$(date +%s)" | ||
run: echo "timestamp=$(date +%s)" >> $GITHUB_OUTPUT | ||
|
||
- name: Deploy to Cloud Run | ||
id: deploy | ||
uses: google-github-actions/deploy-cloudrun@v0.9.0 | ||
uses: google-github-actions/deploy-cloudrun@v0.10.3 | ||
with: | ||
region: us-central1 | ||
service: rails-google-cloud-quickstart-${{ inputs.deploy-name }} | ||
|
@@ -83,6 +91,8 @@ jobs: | |
DATABASE_URL=postgres://%2Fcloudsql%2F${{ steps.url-encode-cloud-sql-instance.outputs.encoded-value }}/${{ env.DATABASE_NAME }} | ||
GOOGLE_CLOUD_PROJECT=rails-google-cloud-quickstart | ||
flags: |- | ||
--cpu ${{ inputs.cloud-run-service-cpu-count }} | ||
--memory ${{ inputs.cloud-run-service-memory }} | ||
--allow-unauthenticated | ||
--add-cloudsql-instances ${{ inputs.cloud-sql-instance }} | ||
--min-instances=${{ inputs.cloud-run-minimum-instances }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,29 +27,29 @@ jobs: | |
|
||
steps: | ||
- name: Checkout the code | ||
uses: actions/checkout@v3.0.2 | ||
uses: actions/checkout@v3.1.0 | ||
|
||
- # We'll generate a unique id that we'll use to identify the build run | ||
# on our systems | ||
name: Generate UUID for build | ||
id: uuidgen | ||
run: echo "::set-output name=uuid::$(uuidgen)" | ||
run: echo "uuid=$(uuidgen)" >> $GITHUB_OUTPUT | ||
|
||
- name: Set additional variables | ||
id: variables | ||
uses: icalia-actions/[email protected] | ||
|
||
- name: Set build timestamp | ||
id: set-build-timestamp | ||
run: echo "::set-output name=timestamp::$(date +%s)" | ||
run: echo "timestamp=$(date +%s)" >> $GITHUB_OUTPUT | ||
|
||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v2.0.0 | ||
uses: docker/setup-buildx-action@v2.2.1 | ||
|
||
- name: Build Test Image | ||
id: build-test-image | ||
uses: docker/build-push-action@v3.1.1 | ||
uses: docker/build-push-action@v3.2.0 | ||
with: | ||
load: true | ||
target: testing | ||
|
@@ -97,20 +97,20 @@ jobs: | |
tmp/capybara/screenshots | ||
# - name: Authenticate to Google Cloud | ||
# uses: google-github-actions/auth@v0.8.0 | ||
# uses: google-github-actions/auth@v1.0.0 | ||
# with: | ||
# service_account: github-actions-runner@rails-google-cloud-quickstart.iam.gserviceaccount.com | ||
# workload_identity_provider: projects/000000000000/locations/global/workloadIdentityPools/devops/providers/github | ||
|
||
# - name: Set up Google Cloud SDK | ||
# uses: google-github-actions/setup-gcloud@v0.6.0 | ||
# uses: google-github-actions/setup-gcloud@v1.0.0 | ||
|
||
# - name: Authorize push to Google Cloud Artifact Registry | ||
# run: gcloud auth configure-docker us-central1-docker.pkg.dev | ||
|
||
# - name: Build & Push Release Image | ||
# id: build-and-push-release-image | ||
# uses: docker/build-push-action@v3.1.1 | ||
# uses: docker/build-push-action@v3.2.0 | ||
# with: | ||
# push: true | ||
# target: release | ||
|