Skip to content

chore(deps): update dependency selenium-webdriver to v4.21.1 #465

chore(deps): update dependency selenium-webdriver to v4.21.1

chore(deps): update dependency selenium-webdriver to v4.21.1 #465

Workflow file for this run

name: cloud-run-sample
on:
push:
branches:
- '**'
tags-ignore:
- 'v*.*.*'
workflow_dispatch:
env:
# TODO: Git のタグを取得して、イメージのタグにする
DOCKER_IMAGE: asia-northeast1-docker.pkg.dev/${{ secrets.CLOUD_RUN_PROJECT }}/cloud-run-source-deploy/cloud-run-sample-rails-app
GCP_REGION: ${{ secrets.CLOUD_RUN_REGION }}
RAILS_ENV: test
PG_HOST_TEST: localhost
PG_PORT_TEST: 5432
PG_USER_TEST: postgres_user
PG_PASS_TEST: postgres_password
jobs:
rails_app_test:
name: Rails アプリのテスト
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16.3
ports:
- 5432:5432
env:
POSTGRES_USER: postgres_user
POSTGRES_PASSWORD: postgres_password
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: コードをチェックアウトする
uses: actions/checkout@v4
- name: Ruby のセットアップを行う
uses: ruby/setup-ruby@v1
with:
ruby-version: .ruby-version
bundler-cache: true
- name: データベースをセットアップする
run: |
bin/rails db:prepare
bin/rails db:seed
- name: RSpec を実行する
run: |
bundle exec rspec
deploy_to_cloud_run:
needs: rails_app_test
if: ${{ github.ref_name == 'main' }}
name: Cloud Run に production デプロイする
runs-on: ubuntu-latest
steps:
- name: ソースコードをチェックアウトする
uses: actions/checkout@v4
- name: GCP の認証を行う
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCP_SERVICE_ACCOUNT_CREDENTIALS }}
- name: GCP の CLI の認証を行う
run: |
gcloud auth configure-docker asia-northeast1-docker.pkg.dev
- name: Docker イメージ をビルドする
run: |
docker build -t ${{ env.DOCKER_IMAGE }} .
- name: Docker イメージ をプッシュする
run: |
docker push ${{ env.DOCKER_IMAGE }}
- name: Deploy to Cloud Run
uses: google-github-actions/deploy-cloudrun@v2
with:
service: cloud-run-sample-rails-app
image: ${{ env.DOCKER_IMAGE }}
region: ${{ env.GCP_REGION }}