Skip to content

Instantly share code, notes, and snippets.

@reaperes
Created January 13, 2022 01:14
Show Gist options
  • Save reaperes/5eea77cbddbee860950311b17d97b93f to your computer and use it in GitHub Desktop.
Save reaperes/5eea77cbddbee860950311b17d97b93f to your computer and use it in GitHub Desktop.
Github deploy workflow vis CodeDeploy with github
name: Deploy main branch to production
on:
push:
branches: [ main ]
env:
DEPLOY_IAM_ROLE: arn:aws:iam::1234567890:role/deployer
GITHUB_REPOSITORY: org/repo
jobs:
build:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
strategy:
matrix:
node-version: [16.x]
steps:
- uses: actions/checkout@v2
- name: Assume IAM role
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ env.DEPLOY_IAM_ROLE }}
aws-region: ap-northeast-2
- name: Create code deploy
run: aws deploy create-deployment --application-name app --deployment-group-name group --github-location repository=$GITHUB_REPOSITORY,commitId=$GITHUB_SHA
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment