{"id":114,"date":"2026-03-09T03:06:56","date_gmt":"2026-03-09T03:06:56","guid":{"rendered":"https:\/\/blog.rebalai.com\/ja\/2026\/03\/09\/pythongithub-actions-2\/"},"modified":"2026-03-09T04:59:38","modified_gmt":"2026-03-09T04:59:38","slug":"pythongithub-actions-2","status":"publish","type":"post","link":"https:\/\/blog.rebalai.com\/ja\/2026\/03\/09\/pythongithub-actions-2\/","title":{"rendered":"Python\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3078\u306eGitHub Actions\u306e\u8a2d\u5b9a: \u81ea\u5206\u304c2\u9031\u9593\u304b\u3051\u3066\u5b66\u3093\u3060\u3053\u3068"},"content":{"rendered":"<p>\u53bb\u5e74\u306e\u79cb\u3001\u5c0f\u898f\u6a21\u306aSaaS\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\uff08FastAPI\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u3001PostgreSQL\u3001\u30c1\u30fc\u30e0\u306f\u81ea\u5206\u542b\u3081\u30663\u4eba\uff09\u306eCI\/CD\u3092CircleCI\u304b\u3089GitHub Actions\u3078\u79fb\u884c\u3059\u308b\u3053\u3068\u306b\u306a\u3063\u305f\u3002\u7406\u7531\u306f\u5358\u7d14\u3067\u3001\u30b3\u30b9\u30c8\u3060\u3002CircleCI\u306e\u8acb\u6c42\u66f8\u304c\u6708\u3005\u3058\u308f\u3058\u308f\u5897\u3048\u3066\u3044\u3066\u3001\u3042\u308b\u6642\u300cGitHub\u306b\u3059\u3067\u306b\u6255\u3063\u3066\u308b\u306e\u306b\u3001\u306a\u305cCI\u307e\u3067\u5225\u30b5\u30fc\u30d3\u30b9\u306b\u6255\u3046\u3093\u3060\u308d\u3046\u300d\u3068\u6c17\u3065\u3044\u305f\u3002<\/p>\n<p>\u79fb\u884c\u81ea\u4f53\u306f2\u9031\u9593\u304b\u304b\u3063\u305f\u3002\u601d\u3063\u305f\u3088\u308a\u9577\u304b\u3063\u305f\u2014\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u304c\u5c11\u306a\u3044\u304b\u3089\u3058\u3083\u306a\u304f\u3001\u60c5\u5831\u304c\u591a\u3059\u304e\u3066\u4f55\u304c\u81ea\u5206\u306e\u30e6\u30fc\u30b9\u30b1\u30fc\u30b9\u306b\u5408\u3046\u306e\u304b\u3092\u898b\u6975\u3081\u308b\u306e\u306b\u6642\u9593\u304c\u304b\u304b\u3063\u305f\u304b\u3089\u3002\u3053\u306e\u8a18\u4e8b\u306f\u305d\u306e\u7d4c\u9a13\u304b\u3089\u66f8\u3044\u3066\u3044\u308b\u3002\u7279\u306bPython\u30a2\u30d7\u30ea\u3092\u5bfe\u8c61\u306b\u3001\u5b9f\u969b\u306b\u52d5\u3044\u3066\u3044\u308b\u8a2d\u5b9a\u3092\u5171\u6709\u3059\u308b\u3002<\/p>\n<hr \/>\n<h2>\u307e\u305a\u57fa\u672c\u306e\u30ef\u30fc\u30af\u30d5\u30ed\u30fc\u304b\u3089\u4f5c\u308b<\/h2>\n<p>GitHub Actions\u306e\u30ef\u30fc\u30af\u30d5\u30ed\u30fc\u306f <code>.github\/workflows\/<\/code> \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306bYAML\u30d5\u30a1\u30a4\u30eb\u3068\u3057\u3066\u7f6e\u304f\u3002\u30d5\u30a1\u30a4\u30eb\u540d\u306f\u4f55\u3067\u3082\u3044\u3044\u3002\u81ea\u5206\u306f <code>ci.yml<\/code> \u306b\u3057\u3066\u3044\u308b\u3002\u30b7\u30f3\u30d7\u30eb\u306b\u3002<\/p>\n<p>\u6700\u521d\u306b\u4f5c\u3063\u305f\u6700\u4f4e\u9650\u306e\u30ef\u30fc\u30af\u30d5\u30ed\u30fc\u306f\u3053\u3093\u306a\u611f\u3058\u3060\u3063\u305f:<\/p>\n<pre><code class=\"language-yaml\"># .github\/workflows\/ci.yml\nname: CI\n\non:\n  push:\n    branches: [main, develop]\n  pull_request:\n    branches: [main]\n\njobs:\n  test:\n    runs-on: ubuntu-latest\n\n    steps:\n      - uses: actions\/checkout@v4\n\n      - name: Set up Python\n        uses: actions\/setup-python@v5\n        with:\n          python-version: &quot;3.12&quot;\n\n      - name: Install dependencies\n        run: |\n          pip install --upgrade pip\n          pip install -r requirements.txt\n\n      - name: Run tests\n        run: pytest tests\/ -v\n<\/code><\/pre>\n<p>\u3053\u308c\u3067\u52d5\u304f\u3002\u305f\u3060\u3001\u3053\u306e\u307e\u307e\u3060\u3068\u6bce\u56de <code>pip install<\/code> \u304c\u8d70\u308b\u306e\u3067\u9045\u3044\u3002\u4f9d\u5b58\u95a2\u4fc2\u304c\u591a\u3044\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3060\u3068\u7279\u306b\u3002\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u8ffd\u52a0\u3059\u308b\u3060\u3051\u3067\u4f53\u611f\u304c\u304b\u306a\u308a\u5909\u308f\u308b\u3002<\/p>\n<hr \/>\n<h2>\u30ad\u30e3\u30c3\u30b7\u30e5\u3068Python\u30d0\u30fc\u30b8\u30e7\u30f3\u884c\u5217\u3067\u5b9f\u7528\u7684\u306b\u3059\u308b<\/h2>\n<p><code>setup-python<\/code> \u30a2\u30af\u30b7\u30e7\u30f3\uff08v5\u4ee5\u964d\uff09\u306b\u306f\u30ad\u30e3\u30c3\u30b7\u30e5\u6a5f\u80fd\u304c\u5185\u8535\u3055\u308c\u3066\u3044\u308b\u3002<code>cache: 'pip'<\/code> \u3092\u6307\u5b9a\u3059\u308b\u3060\u3051\u3067\u3044\u3044\u3002\u5730\u5473\u3060\u3051\u3069\u3053\u308c\u304c\u4e00\u756a\u52b9\u3044\u305f\u6539\u5584\u3060\u3063\u305f\u2014\u30d1\u30a4\u30d7\u30e9\u30a4\u30f3\u306e\u5b9f\u884c\u6642\u9593\u304c\u534a\u5206\u8fd1\u304f\u306b\u7e2e\u3093\u3060\u3002<\/p>\n<p>\u8907\u6570\u306ePython\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u30c6\u30b9\u30c8\u3059\u308b\u3053\u3068\u3082\u91cd\u8981\u3060\u3002\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u4f5c\u3063\u3066\u3044\u308b\u306a\u3089\u7279\u306b\u3002<\/p>\n<pre><code class=\"language-yaml\">name: CI\n\non:\n  push:\n    branches: [main]\n  pull_request:\n\njobs:\n  test:\n    runs-on: ubuntu-latest\n    strategy:\n      fail-fast: false  # \u4e00\u3064\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u304c\u843d\u3061\u3066\u3082\u4ed6\u306f\u7d9a\u3051\u308b\n      matrix:\n        python-version: [&quot;3.10&quot;, &quot;3.11&quot;, &quot;3.12&quot;]\n\n    steps:\n      - uses: actions\/checkout@v4\n\n      - name: Set up Python ${{ matrix.python-version }}\n        uses: actions\/setup-python@v5\n        with:\n          python-version: ${{ matrix.python-version }}\n          cache: &quot;pip&quot;           # requirements.txt\u306e\u30cf\u30c3\u30b7\u30e5\u3067\u30ad\u30e3\u30c3\u30b7\u30e5\n          cache-dependency-path: &quot;requirements*.txt&quot;\n\n      - name: Install dependencies\n        run: |\n          pip install --upgrade pip\n          pip install -r requirements.txt\n          pip install -r requirements-dev.txt\n\n      - name: Run linting (Ruff)\n        run: ruff check .\n\n      - name: Run type checking (mypy)\n        run: mypy src\/\n\n      - name: Run tests with coverage\n        run: |\n          pytest tests\/ \\\n            --cov=src \\\n            --cov-report=xml \\\n            --cov-report=term-missing \\\n            -v\n\n      - name: Upload coverage report\n        uses: codecov\/codecov-action@v5\n        if: matrix.python-version == '3.12'  # \u30ab\u30d0\u30ec\u30c3\u30b8\u306f1\u56de\u3060\u3051\u4e0a\u3052\u308b\n        with:\n          token: ${{ secrets.CODECOV_TOKEN }}\n          files: .\/coverage.xml\n<\/code><\/pre>\n<p><code>fail-fast: false<\/code> \u306f\u5730\u5473\u306b\u91cd\u8981\u3060\u3068\u601d\u3063\u3066\u3044\u308b\u30023.10\u3067\u843d\u3061\u305f\u3068\u304d\u30013.12\u3067\u306e\u7d50\u679c\u3082\u898b\u305f\u3044\u3053\u3068\u304c\u591a\u3044\u304b\u3089\u3002\u30c7\u30d5\u30a9\u30eb\u30c8\u306ftrue\u3067\u3001\u4e00\u3064\u843d\u3061\u308b\u3068\u5168\u90e8\u6b62\u307e\u308b\u3002<\/p>\n<p>lint\u306fRuff\u3092\u4f7f\u3063\u3066\u3044\u308b\u3002flake8 + isort + black\u306e\u7d44\u307f\u5408\u308f\u305b\u3092\u9577\u5e74\u4f7f\u3063\u3066\u3044\u305f\u3051\u3069\u3001Ruff\u306b\u79fb\u884c\u3057\u3066\u304b\u3089\u8a2d\u5b9a\u304c\u5727\u5012\u7684\u306b\u30b7\u30f3\u30d7\u30eb\u306b\u306a\u3063\u305f\u3002\u901f\u5ea6\u3082\u901f\u3044\u3002\u6b63\u76f4\u3001\u3082\u3063\u3068\u65e9\u304f\u79fb\u884c\u3059\u308c\u3070\u3088\u304b\u3063\u305f\u3002<\/p>\n<hr \/>\n<h2>\u30b7\u30fc\u30af\u30ec\u30c3\u30c8\u3068\u74b0\u5883\u5909\u6570\u306e\u30cf\u30de\u308a\u3069\u3053\u308d<\/h2>\n<p>\u3053\u3053\u304c\u6700\u521d\u306b\u8a70\u307e\u3063\u305f\u90e8\u5206\u3060\u3002DB\u306eURL\u3084API\u30ad\u30fc\u3092\u3069\u3046\u6e21\u3059\u304b\u3002<\/p>\n<p>GitHub Actions\u306eSecrets\u306f <code>Settings &gt; Secrets and variables &gt; Actions<\/code> \u304b\u3089\u8a2d\u5b9a\u3059\u308b\u3002\u30ef\u30fc\u30af\u30d5\u30ed\u30fc\u304b\u3089\u306f <code>${{ secrets.MY_SECRET }}<\/code> \u3067\u53c2\u7167\u3067\u304d\u308b\u3002\u3053\u3053\u306f\u554f\u984c\u306a\u3044\u3002<\/p>\n<p>\u554f\u984c\u306f\u30c6\u30b9\u30c8\u7528\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3060\u3002PostgreSQL\u3092\u4f7f\u3063\u3066\u3044\u308b\u30c6\u30b9\u30c8\u306f\u3001CI\u3067\u3082DB\u304c\u5fc5\u8981\u306b\u306a\u308b\u3002\u6700\u521d\u306fDocker\u3092\u81ea\u5206\u3067\u8d77\u52d5\u3057\u3088\u3046\u3068\u3057\u305f\u3051\u3069\u3001GitHub Actions\u306b\u306f <code>services<\/code> \u3068\u3044\u3046\u4ed5\u7d44\u307f\u304c\u3042\u3063\u3066\u305d\u3063\u3061\u306e\u65b9\u304c\u304d\u308c\u3044\u306b\u66f8\u3051\u308b:<\/p>\n<pre><code class=\"language-yaml\">jobs:\n  test:\n    runs-on: ubuntu-latest\n\n    services:\n      postgres:\n        image: postgres:16\n        env:\n          POSTGRES_USER: testuser\n          POSTGRES_PASSWORD: testpass\n          POSTGRES_DB: testdb\n        ports:\n          - 5432:5432\n        # \u30d8\u30eb\u30b9\u30c1\u30a7\u30c3\u30af: DB\u304c\u8d77\u52d5\u3059\u308b\u307e\u3067\u5f85\u3064 (\u3053\u308c\u3092\u5fd8\u308c\u308b\u3068\u63a5\u7d9a\u30a8\u30e9\u30fc\u306b\u306a\u308b)\n        options: &gt;-\n          --health-cmd pg_isready\n          --health-interval 10s\n          --health-timeout 5s\n          --health-retries 5\n\n    env:\n      DATABASE_URL: postgresql:\/\/testuser:testpass@localhost:5432\/testdb\n\n    steps:\n      - uses: actions\/checkout@v4\n      # ... \u4ee5\u4e0b\u306f\u901a\u5e38\u901a\u308a\n<\/code><\/pre>\n<p><code>options<\/code> \u306e\u30d8\u30eb\u30b9\u30c1\u30a7\u30c3\u30af\u8a2d\u5b9a\u3092\u5fd8\u308c\u308b\u3068\u300c\u63a5\u7d9a\u62d2\u5426\u300d\u30a8\u30e9\u30fc\u3067\u8a70\u307e\u308b\u3002\u81ea\u5206\u306f\u6700\u521d\u3053\u308c\u3092\u7701\u3044\u306630\u5206\u304f\u3089\u3044\u539f\u56e0\u3092\u63a2\u3057\u305f\u3002PostgreSQL<a href=\"https:\/\/m.do.co\/c\/06956e5e2802\" title=\"DigitalOcean \u3067\u30b3\u30f3\u30c6\u30ca\u3092\u5b9f\u884c\" rel=\"nofollow sponsored\" target=\"_blank\">\u30b3\u30f3\u30c6\u30ca<\/a>\u81ea\u4f53\u306f\u8d77\u52d5\u3057\u3066\u3044\u308b\u306e\u306b\u30a2\u30d7\u30ea\u304c\u7e4b\u304c\u308c\u306a\u3044\u2014DB\u30d7\u30ed\u30bb\u30b9\u306e\u521d\u671f\u5316\u304c\u307e\u3060\u7d42\u308f\u3063\u3066\u3044\u306a\u3044\u304b\u3089\u3002\u30d8\u30eb\u30b9\u30c1\u30a7\u30c3\u30af\u3092\u5165\u308c\u308b\u3068\u3001DB\u304c\u6e96\u5099\u3067\u304d\u3066\u304b\u3089\u30b8\u30e7\u30d6\u304c\u9032\u3080\u3088\u3046\u306b\u306a\u308b\u3002<\/p>\n<p>\u30b7\u30fc\u30af\u30ec\u30c3\u30c8\u306b\u3064\u3044\u3066\u3082\u3046\u4e00\u3064: \u30d5\u30a9\u30fc\u30af\u304b\u3089\u306ePull Request\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u30b7\u30fc\u30af\u30ec\u30c3\u30c8\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u306a\u3044\u3002\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u5916\u90e8\u30b3\u30f3\u30c8\u30ea\u30d3\u30e5\u30fc\u30bf\u30fc\u306ePR\u3092\u53d7\u3051\u4ed8\u3051\u308b\u306a\u3089\u3001\u3053\u306e\u5236\u7d04\u3092\u5ff5\u982d\u306b\u7f6e\u304f\u5fc5\u8981\u304c\u3042\u308b\u3002<code>pull_request_target<\/code> \u3068\u3044\u3046\u30a4\u30d9\u30f3\u30c8\u3082\u3042\u308b\u304c\u3001\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u4e0a\u306e\u843d\u3068\u3057\u7a74\u304c\u3042\u308b\u306e\u3067\u614e\u91cd\u306b\u4f7f\u3046\u5fc5\u8981\u304c\u3042\u308b\uff08\u3053\u3053\u306f\u6b63\u76f4100%\u81ea\u4fe1\u3092\u6301\u3063\u3066\u8a9e\u308c\u308b\u9818\u57df\u3058\u3083\u306a\u3044\u306e\u3067\u3001\u516c\u5f0f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3092\u53c2\u7167\u3057\u3066\u307b\u3057\u3044\uff09\u3002<\/p>\n<hr \/>\n<h2>Dependabot\u3068\u306e\u7d44\u307f\u5408\u308f\u305b: \u81ea\u52d5\u4f9d\u5b58\u95a2\u4fc2\u66f4\u65b0<\/h2>\n<p>\u3053\u308c\u306f\u304a\u307e\u3051\u7684\u306a\u8a71\u3060\u304c\u3001\u8a2d\u5b9a\u3057\u3066\u304b\u3089\u660e\u3089\u304b\u306b\u697d\u306b\u306a\u3063\u305f\u3002<\/p>\n<p><code>.github\/dependabot.yml<\/code> \u3092\u7f6e\u304f\u3060\u3051\u3067\u3001\u4f9d\u5b58\u95a2\u4fc2\u306e\u66f4\u65b0PR\u3092\u81ea\u52d5\u3067\u4f5c\u3063\u3066\u304f\u308c\u308b:<\/p>\n<pre><code class=\"language-yaml\"># .github\/dependabot.yml\nversion: 2\nupdates:\n  - package-ecosystem: &quot;pip&quot;\n    directory: &quot;\/&quot;\n    schedule:\n      interval: &quot;weekly&quot;\n      day: &quot;monday&quot;\n    open-pull-requests-limit: 5\n    groups:\n      # \u30de\u30a4\u30ca\u30fc\u30fb\u30d1\u30c3\u30c1\u306e\u66f4\u65b0\u306f\u307e\u3068\u3081\u3066PR\u306b\u3059\u308b\n      minor-and-patch:\n        update-types:\n          - &quot;minor&quot;\n          - &quot;patch&quot;\n\n  - package-ecosystem: &quot;github-actions&quot;\n    directory: &quot;\/&quot;\n    schedule:\n      interval: &quot;monthly&quot;  # Actions\u306e\u66f4\u65b0\u306f\u67081\u56de\u3067\u5341\u5206\n<\/code><\/pre>\n<p><code>groups<\/code> \u306e\u8a2d\u5b9a\u306fDependabot v2\u304b\u3089\u4f7f\u3048\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u6a5f\u80fd\u3067\u3001\u30de\u30a4\u30ca\u30fc\u30fb\u30d1\u30c3\u30c1\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3092\u307e\u3068\u3081\u30661\u3064\u306ePR\u306b\u3057\u3066\u304f\u308c\u308b\u3002\u3053\u308c\u304c\u306a\u3044\u3068\u6bce\u903110\u301c20\u500b\u306ePR\u304c\u6765\u3066\u3001\u30ec\u30d3\u30e5\u30fc\u304c\u8ffd\u3044\u3064\u304b\u306a\u304f\u306a\u308b\u3002\u6b63\u76f4\u3001\u3053\u306e\u6a5f\u80fd\u304c\u6765\u308b\u524d\u306eDependabot\u306f\u3061\u3087\u3063\u3068\u9b31\u9676\u3057\u304b\u3063\u305f\uff08\u30c1\u30fc\u30e0\u304b\u3089\u300c\u307e\u305f\u66f4\u65b0PR\u6765\u3066\u308b\u300d\u3068\u8a00\u308f\u308c\u308b\u4fc2\u306b\u306a\u308b\u3084\u3064\u3060\uff09\u3002<\/p>\n<p>GitHub Actions\u306e\u30a2\u30af\u30b7\u30e7\u30f3\u3082Dependabot\u3067\u7ba1\u7406\u3067\u304d\u308b\u70b9\u306f\u610f\u5916\u3068\u77e5\u3089\u308c\u3066\u3044\u306a\u3044\u3002<code>actions\/checkout@v4<\/code> \u306e\u3088\u3046\u306a\u53c2\u7167\u304c\u53e4\u304f\u306a\u3063\u3066\u3082\u81ea\u52d5\u3067PR\u304c\u6765\u308b\u3002<\/p>\n<hr \/>\n<h2>\u30c7\u30d7\u30ed\u30a4\u30ef\u30fc\u30af\u30d5\u30ed\u30fc: main\u3078\u306e\u30de\u30fc\u30b8\u5f8c\u306b\u81ea\u52d5\u30c7\u30d7\u30ed\u30a4<\/h2>\n<p>CI\u304c\u901a\u3063\u305f\u3089\u81ea\u52d5\u3067<a href=\"https:\/\/m.do.co\/c\/06956e5e2802\" title=\"DigitalOcean\u3067\u30c7\u30d7\u30ed\u30a4\" rel=\"nofollow sponsored\" target=\"_blank\">\u30c7\u30d7\u30ed\u30a4<\/a>\u3057\u305f\u3044\u3002\u81ea\u5206\u305f\u3061\u306fAWS ECS\u3092\u4f7f\u3063\u3066\u3044\u3066\u3001Docker\u30a4\u30e1\u30fc\u30b8\u3092\u30d3\u30eb\u30c9\u3057\u3066 ECR \u306b\u30d7\u30c3\u30b7\u30e5\u3057\u3001ECS\u306e\u30b5\u30fc\u30d3\u30b9\u3092\u66f4\u65b0\u3059\u308b\u30d5\u30ed\u30fc\u306b\u306a\u3063\u3066\u3044\u308b\u3002<\/p>\n<p>\u30b8\u30e7\u30d6\u9593\u306e\u4f9d\u5b58\u95a2\u4fc2\u306f <code>needs<\/code> \u3067\u8868\u73fe\u3059\u308b\u3002\u5168\u90e8\u66f8\u304f\u3068\u9577\u304f\u306a\u308b\u306e\u3067\u8981\u70b9\u3060\u3051:<\/p>\n<pre><code class=\"language-yaml\">jobs:\n  test:\n    # ... \u30c6\u30b9\u30c8\u30b8\u30e7\u30d6\n\n  build-and-<a href=\"https:\/\/m.do.co\/c\/06956e5e2802\" title=\"Deploy on DigitalOcean Cloud\" rel=\"nofollow sponsored\" target=\"_blank\">deploy<\/a>:\n    needs: test          # test\u30b8\u30e7\u30d6\u304c\u6210\u529f\u3057\u3066\u304b\u3089\u5b9f\u884c\n    if: github.ref == 'refs\/heads\/main' &amp;&amp; github.event_name == 'push'\n    runs-on: ubuntu-latest\n\n    steps:\n      - uses: actions\/checkout@v4\n\n      - name: Configure <a href=\"https:\/\/aws.amazon.com\/?tag=synsun0f-20\" title=\"Amazon Web Services (AWS) Cloud Platform\" rel=\"nofollow sponsored\" target=\"_blank\">AWS<\/a> credentials\n        uses: <a href=\"https:\/\/aws.amazon.com\/?tag=synsun0f-20\" title=\"Amazon Web Services (AWS) Cloud Platform\" rel=\"nofollow sponsored\" target=\"_blank\">aws<\/a>-actions\/configure-aws-credentials@v4\n        with:\n          aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}\n          aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}\n          aws-region: ap-northeast-1\n\n      - name: Login to Amazon ECR\n        id: login-ecr\n        uses: aws-actions\/amazon-ecr-login@v2\n\n      - name: Build and push Docker image\n        env:\n          ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}\n          IMAGE_TAG: ${{ github.sha }}\n        run: |\n          docker build -t $ECR_REGISTRY\/myapp:$IMAGE_TAG .\n          docker push $ECR_REGISTRY\/myapp:$IMAGE_TAG\n\n      - name: <a href=\"https:\/\/m.do.co\/c\/06956e5e2802\" title=\"Deploy on DigitalOcean Cloud\" rel=\"nofollow sponsored\" target=\"_blank\">Deploy<\/a> to ECS\n        run: |\n          aws ecs update-service \\\n            --cluster <a href=\"https:\/\/m.do.co\/c\/06956e5e2802\" title=\"DigitalOcean for <a href=\"https:\/\/m.do.co\/c\/06956e5e2802\" title=\"DigitalOcean for Production Workloads\" rel=\"nofollow sponsored\" target=\"_blank\">Production<\/a> Workloads\" rel=\"nofollow sponsored\" target=\"_blank\">production<\/a> \\\n            --service myapp \\\n            --force-new-deployment\n<\/code><\/pre>\n<p><code>IMAGE_TAG: ${{ github.sha }}<\/code> \u3067\u30b3\u30df\u30c3\u30c8\u30cf\u30c3\u30b7\u30e5\u3092\u30bf\u30b0\u306b\u3057\u3066\u3044\u308b\u306e\u306f\u304a\u3059\u3059\u3081\u3002<code>latest<\/code> \u30bf\u30b0\u3060\u3051\u3060\u3068\u300c\u4eca<a href=\"https:\/\/m.do.co\/c\/06956e5e2802\" title=\"DigitalOcean\u3067\u30c7\u30d7\u30ed\u30a4\" rel=\"nofollow sponsored\" target=\"_blank\">\u30c7\u30d7\u30ed\u30a4<\/a>\u3055\u308c\u3066\u3044\u308b\u306e\u306f\u3069\u306e\u30b3\u30df\u30c3\u30c8\u304b\u300d\u304c\u8ffd\u3044\u306b\u304f\u3044\u3002<\/p>\n<p><code>if: github.ref == 'refs\/heads\/main' &amp;&amp; github.event_name == 'push'<\/code> \u306e\u6761\u4ef6\u3082\u91cd\u8981\u3002\u3053\u308c\u304c\u306a\u3044\u3068\u3001main\u3078\u306ePR\u3092\u4f5c\u3063\u305f\u3060\u3051\u3067\u3082<a href=\"https:\/\/m.do.co\/c\/06956e5e2802\" title=\"DigitalOcean\u3067\u30c7\u30d7\u30ed\u30a4\" rel=\"nofollow sponsored\" target=\"_blank\">\u30c7\u30d7\u30ed\u30a4<\/a>\u304c\u8d70\u3063\u3066\u3057\u307e\u3046\u2014\u5b9f\u969b\u4e00\u5ea6\u3084\u3063\u305f\u3002<\/p>\n<hr \/>\n<h2>\u5b9f\u969b\u306b\u904b\u7528\u3057\u3066\u6c17\u3065\u3044\u305f\u3053\u3068<\/h2>\n<p><strong>\u30ef\u30fc\u30af\u30d5\u30ed\u30fc\u306e\u5b9f\u884c\u6642\u9593\u306f\u610f\u8b58\u3059\u308b<\/strong>: GitHub Actions\u306f\u7121\u6599\u67a0\u304c\u3042\u308b\u304c\uff08\u30d1\u30d6\u30ea\u30c3\u30af\u30ea\u30dd\u30b8\u30c8\u30ea\u306f\u7121\u5236\u9650\u3001\u30d7\u30e9\u30a4\u30d9\u30fc\u30c8\u306f\u67082000\u5206\uff09\u3001\u30c1\u30fc\u30e0\u304c\u5897\u3048\u308b\u3068\u67a0\u3092\u8d85\u3048\u308b\u3053\u3068\u304c\u3042\u308b\u3002\u81ea\u5206\u305f\u3061\u306f <code>paths<\/code> \u30d5\u30a3\u30eb\u30bf\u30fc\u3092\u4f7f\u3063\u3066\u3001\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306e\u5909\u66f4\u3060\u3051\u306ePR\u3067\u306f\u30c6\u30b9\u30c8\u3092\u8d70\u3089\u305b\u306a\u3044\u3088\u3046\u306b\u3057\u305f\u3002<\/p>\n<pre><code class=\"language-yaml\">on:\n  push:\n    paths-ignore:\n      - &quot;docs\/**&quot;\n      - &quot;*.md&quot;\n      - &quot;.gitignore&quot;\n<\/code><\/pre>\n<p><strong>\u30b3\u30f3\u30ab\u30ec\u30f3\u30b7\u30fc\u306e\u5236\u5fa1<\/strong>: \u540c\u3058\u30d6\u30e9\u30f3\u30c1\u3078\u306e\u9023\u7d9a\u30d7\u30c3\u30b7\u30e5\u3067\u8907\u6570\u306e\u30ef\u30fc\u30af\u30d5\u30ed\u30fc\u304c\u8d70\u308b\u3068\u7121\u99c4\u306b\u306a\u308b\u3002<code>concurrency<\/code> \u3067\u5236\u5fa1\u3067\u304d\u308b:<\/p>\n<pre><code class=\"language-yaml\">concurrency:\n  group: ${{ github.workflow }}-${{ github.ref }}\n  cancel-in-progress: true  # \u53e4\u3044\u5b9f\u884c\u3092\u30ad\u30e3\u30f3\u30bb\u30eb\u3057\u3066\u6700\u65b0\u3060\u3051\u8d70\u3089\u305b\u308b\n<\/code><\/pre>\n<p>\u3053\u308c\u3092\u5165\u308c\u3066\u304b\u3089CI\u306e\u7121\u99c4\u306a\u5b9f\u884c\u304c\u304b\u306a\u308a\u6e1b\u3063\u305f\u3002<\/p>\n<p><strong>\u30a2\u30af\u30b7\u30e7\u30f3\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306f\u30b3\u30df\u30c3\u30c8\u30cf\u30c3\u30b7\u30e5\u3067\u56fa\u5b9a\u3059\u308b\u9078\u629e\u80a2\u3082\u3042\u308b<\/strong>: \u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u610f\u8b58\u304c\u9ad8\u3044\u7d44\u7e54\u3067\u306f <code>actions\/checkout@v4<\/code> \u306e\u4ee3\u308f\u308a\u306b <code>actions\/checkout@&lt;\u30b3\u30df\u30c3\u30c8\u30cf\u30c3\u30b7\u30e5&gt;<\/code> \u3092\u4f7f\u3046\u3053\u3068\u304c\u3042\u308b\u3002\u30bf\u30b0\u306f\u66f8\u304d\u63db\u3048\u3089\u308c\u308b\u53ef\u80fd\u6027\u304c\u3042\u308b\u304c\u3001\u30b3\u30df\u30c3\u30c8\u30cf\u30c3\u30b7\u30e5\u306f\u4e0d\u5909\u3060\u304b\u3089\u30023\u4eba\u30c1\u30fc\u30e0\u3067\u306f\u305d\u3053\u307e\u3067\u3084\u3063\u3066\u3044\u306a\u3044\u304c\u3001\u30a8\u30f3\u30bf\u30fc\u30d7\u30e9\u30a4\u30ba\u74b0\u5883\u306a\u3089\u691c\u8a0e\u3059\u308b\u4fa1\u5024\u304c\u3042\u308b\u3002<\/p>\n<p><strong>\u30b8\u30e7\u30d6\u9593\u306e\u51fa\u529b\u5024\u306e\u53d7\u3051\u6e21\u3057\u306b\u306f\u6ce8\u610f<\/strong>: \u5730\u5473\u306b\u30cf\u30de\u3063\u305f\u306e\u304c\u3053\u3053\u3060\u3002\u30b8\u30e7\u30d6\u3092\u307e\u305f\u3044\u3067\u5024\u3092\u6e21\u3059\u306b\u306f\u3001\u9001\u308a\u5074\u306e\u30b8\u30e7\u30d6\u3067 <code>outputs<\/code> \u3092\u660e\u793a\u7684\u306b\u5b9a\u7fa9\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002\u30b9\u30c6\u30c3\u30d7\u306e\u51fa\u529b\u3092 <code>jobs.&lt;job_id&gt;.outputs<\/code> \u306b\u542b\u3081\u306a\u3044\u3068\u3001\u6b21\u306e\u30b8\u30e7\u30d6\u304b\u3089 <code>${{ needs.&lt;job_id&gt;.outputs.xxx }}<\/code> \u3067\u53c2\u7167\u3067\u304d\u306a\u3044\u2014\u300c\u306a\u3093\u3067\u7a7a\u306b\u306a\u308b\u3093\u3060\u300d\u306830\u5206\u60a9\u3093\u3060\u3053\u3068\u304c\u3042\u308b\u3002<\/p>\n<hr \/>\n<h2>\u81ea\u5206\u304c\u5b9f\u969b\u306b\u63a8\u5968\u3059\u308b\u69cb\u6210<\/h2>\n<p>\u79fb\u884c\u304b\u3089\u534a\u5e74\u7d4c\u3063\u305f\u4eca\u306e\u8996\u70b9\u3067\u8a00\u3046\u3068:<\/p>\n<p><strong>\u5c0f\u898f\u6a21\u30c1\u30fc\u30e0\u30fb\u500b\u4eba\u30d7\u30ed\u30b8\u30a7\u30af\u30c8<\/strong>\u306a\u3089\u3001\u6700\u521d\u306e\u57fa\u672c\u30ef\u30fc\u30af\u30d5\u30ed\u30fc + \u30ad\u30e3\u30c3\u30b7\u30e5\u3067\u5341\u5206\u3060\u3002Dependabot\u3082\u521d\u65e5\u304b\u3089\u6709\u52b9\u306b\u3057\u3066\u304a\u304f\u3002\u8907\u6570Python\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\u30de\u30c8\u30ea\u30c3\u30af\u30b9\u306f\u3001\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u516c\u958b\u3059\u308b\u306a\u3089\u5fc5\u8981\u3060\u304c\u3001\u5185\u90e8\u30a2\u30d7\u30ea\u306a\u30891\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u5341\u5206\u306a\u3053\u3068\u304c\u591a\u3044\u3002<\/p>\n<p><strong>\u8907\u6570\u4eba\u304c\u95a2\u308f\u308b\u30d7\u30ed\u30b8\u30a7\u30af\u30c8<\/strong>\u3067\u306f\u3001lint\u3068type check\u3092CI\u3067\u5f37\u5236\u3059\u308b\u306e\u304c\u9577\u671f\u7684\u306b\u52b9\u3044\u3066\u304f\u308b\u3002PR\u3054\u3068\u306b\u300c\u3053\u3053\u306e\u30a4\u30f3\u30dd\u30fc\u30c8\u9806\u304c&#8230;\u300d\u307f\u305f\u3044\u306a\u30ec\u30d3\u30e5\u30fc\u30b3\u30e1\u30f3\u30c8\u304c\u6d88\u3048\u308b\u3002Ruff\u306e\u5c0e\u5165\u306f\u3053\u3053\u3067\u672c\u5f53\u306b\u697d\u306b\u306a\u3063\u305f\u2014\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u304c1\u3064\u306b\u307e\u3068\u307e\u3063\u3066\u3001CI\u306e\u8a2d\u5b9a\u3082\u30b7\u30f3\u30d7\u30eb\u306b\u306a\u308b\u3002<\/p>\n<p><strong>\u30c7\u30d7\u30ed\u30a4\u307e\u3067\u81ea\u52d5\u5316\u3059\u308b\u306a\u3089<\/strong>\u3001\u30b9\u30c6\u30fc\u30b8\u30f3\u30b0\u74b0\u5883\u3078\u306e<a href=\"https:\/\/m.do.co\/c\/06956e5e2802\" title=\"DigitalOcean\u3067\u30c7\u30d7\u30ed\u30a4\" rel=\"nofollow sponsored\" target=\"_blank\">\u30c7\u30d7\u30ed\u30a4<\/a>\u3092\u5148\u306b\u81ea\u52d5\u5316\u3057\u3066\u3001\u672c\u756a\u306f\u624b\u52d5\u30c8\u30ea\u30ac\u30fc\uff08<code>workflow_dispatch<\/code>\uff09\u306b\u3059\u308b\u6bb5\u968e\u7684\u306a\u30a2\u30d7\u30ed\u30fc\u30c1\u304c\u5b89\u5fc3\u3060\u3068\u601d\u3046\u3002\u5168\u90e8\u81ea\u52d5\u5316\u3057\u305f\u3044\u6c17\u6301\u3061\u306f\u308f\u304b\u308b\u304c\u3001\u672c\u756a\u3078\u306e\u81ea\u52d5<a href=\"https:\/\/m.do.co\/c\/06956e5e2802\" title=\"DigitalOcean\u3067\u30c7\u30d7\u30ed\u30a4\" rel=\"nofollow sponsored\" target=\"_blank\">\u30c7\u30d7\u30ed\u30a4<\/a>\u306f\u4fe1\u983c\u6027\u306e\u9ad8\u3044\u30c6\u30b9\u30c8\u30b9\u30a4\u30fc\u30c8\u304c\u306a\u3044\u3068\u6b63\u76f4\u6016\u3044\u3002<\/p>\n<p>CircleCI\u304b\u3089\u306e\u79fb\u884c\u3092\u5f8c\u6094\u3057\u3066\u3044\u306a\u3044\u7406\u7531\u306f\u30b7\u30f3\u30d7\u30eb\u3067\u3001GitHub\u3068\u540c\u3058\u5834\u6240\u3067\u5168\u90e8\u7ba1\u7406\u3067\u304d\u308b\u306e\u304c\u601d\u3063\u305f\u3088\u308a\u5feb\u9069\u3060\u304b\u3089\u3002PR\u306e\u30b9\u30c6\u30fc\u30bf\u30b9\u30c1\u30a7\u30c3\u30af\u3084Dependabot\u3068\u306e\u9023\u643a\u304c\u81ea\u7136\u306b\u52d5\u304f\u3002CircleCI\u306e\u6642\u306f\u300c\u306a\u305c\u304b\u30b9\u30c6\u30fc\u30bf\u30b9\u304c\u540c\u671f\u3055\u308c\u306a\u3044\u300d\u307f\u305f\u3044\u306a\u554f\u984c\u304c\u5b9a\u671f\u7684\u306b\u3042\u3063\u305f\u2014\u305d\u306e\u9762\u5012\u304c\u306a\u304f\u306a\u3063\u305f\u306e\u306f\u5730\u5473\u306b\u5927\u304d\u3044\u3002<\/p>\n<p>\u307e\u305a\u52d5\u304f\u3082\u306e\u3092\u4f5c\u3063\u3066\u3001\u305d\u3053\u304b\u3089\u5c11\u3057\u305a\u3064\u6539\u5584\u3057\u3066\u3044\u304f\u3002GitHub Actions\u306b\u9650\u3089\u305a\u3001CI\/CD\u306f\u305d\u306e\u30a2\u30d7\u30ed\u30fc\u30c1\u304c\u4e00\u756a\u3046\u307e\u304f\u3044\u304f\u3002<\/p>\n<p><!-- Reviewed: 2026-03-09 | Status: ready_to_publish | Changes: expanded meta_description, added missing ECR login step to <a href=\"https:\/\/m.do.co\/c\/06956e5e2802\" title=\"Deploy on DigitalOcean Cloud\" rel=\"nofollow sponsored\" target=\"_blank\">deploy<\/a> snippet, added job outputs gotcha, tightened em dash usage, added Dependabot personality aside, varied paragraph rhythm, tightened generic conclusion --><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u53bb\u5e74\u306e\u79cb\u3001\u5c0f\u898f\u6a21\u306aSaaS\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\uff08FastAPI\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u3001PostgreSQL\u3001\u30c1\u30fc\u30e0\u306f\u81ea\u5206\u542b\u3081\u30663\u4eba\uff09\u306eCI\/CD\u3092CircleCI\u304b\u3089GitHub Actions\u3078\u79fb\u884c\u3059\u308b\u3053\u3068\u306b\u306a\u3063\u305f\u3002\u7406\u7531\u306f\u5358\u7d14\u3067\u3001\u30b3\u30b9\u30c8\u3060\u3002CircleCI\u306e\u8acb\u6c42\u66f8\u304c\u6708\u3005\u3058\u308f\u3058\u308f\u5897\u3048\u3066\u3044\u3066\u3001\u3042\u308b\u6642\u300cGitHub\u306b\u3059\u3067\u306b\u6255\u3063\u3066\u308b<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[1],"tags":[],"class_list":["post-114","post","type-post","status-publish","format-standard","hentry","category-general"],"_links":{"self":[{"href":"https:\/\/blog.rebalai.com\/ja\/wp-json\/wp\/v2\/posts\/114","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.rebalai.com\/ja\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.rebalai.com\/ja\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.rebalai.com\/ja\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.rebalai.com\/ja\/wp-json\/wp\/v2\/comments?post=114"}],"version-history":[{"count":9,"href":"https:\/\/blog.rebalai.com\/ja\/wp-json\/wp\/v2\/posts\/114\/revisions"}],"predecessor-version":[{"id":187,"href":"https:\/\/blog.rebalai.com\/ja\/wp-json\/wp\/v2\/posts\/114\/revisions\/187"}],"wp:attachment":[{"href":"https:\/\/blog.rebalai.com\/ja\/wp-json\/wp\/v2\/media?parent=114"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.rebalai.com\/ja\/wp-json\/wp\/v2\/categories?post=114"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.rebalai.com\/ja\/wp-json\/wp\/v2\/tags?post=114"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}