0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Github Actionsの自分用メモ

Last updated at Posted at 2023-03-05

hello world

使ってるtokenの権限にworkflowを入れる必要がある。

Github → Settings → Developer Settings → Personal Access Tokens
→ Generate new token

helloworld.yml
name: Hello World

on: 
  workflow_dispatch:

jobs:
  say_hello:
    runs-on: ubuntu-latest
    steps:
      - run: echo "Hello World!"

EC2デプロイ

herokuへpushする時

マーケットプレイスに雛形が載ってる。
https://github.com/marketplace/actions/heroku-action

ソース全体
https://github.com/miyamotok0105/docker_sample/tree/master/01docker/Flask-Basic-CICD-GithubActions-Heroku

.github/workflows/main.yml
# ワークフロー名
name: CI

# Controls when the workflow will run
on:
  # push masterブランチのタイミングで実行
  push:
    branches: [master]

  # workflow_dispatchを指定しておくとGitHubのコンソールから実行可能になる
  workflow_dispatch:

# ワークフローの実行処理
jobs:
  # This workflow contains a single job called "build"
  build:
    # ubuntuで実行
    runs-on: ubuntu-latest

    # ジョブのステップ
    steps:
      # ブランチをチェックアウト
      - uses: actions/checkout@v2

      # アクションの一覧
      # https://github.com/marketplace?type=actions
      # uses: アカウント/アクション-リポジトリ-名前@vバージョン
      - uses: akhileshns/heroku-deploy@v3.12.12 #
        with:
          heroku_api_key: ${{secrets.HEROKU_API_KEY}}
          heroku_app_name: ${{secrets.HEROKU_APP_NAME}}
          heroku_email: ${{secrets.HEROKU_EMAIL}}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?