Created
May 8, 2022 18:03
-
-
Save alsmola/8125d36673312b7cfb7dd85155d1874b to your computer and use it in GitHub Desktop.
GitHub Action configuration to deploy to AWS via OIDC and Serverless
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
name: Deploy main to production | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
contents: read | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.17 | |
- name: Build | |
run: make build | |
- name: Install npm dependencies | |
run: npm install | |
- name: Configure AWS credentials from Test account | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
role-to-assume: arn:aws:iam::[your-account-id]:role/[your-role-name] | |
aws-region: us-east-1 | |
- name: Serverless deploy | |
uses: serverless/github-action@v3 | |
with: | |
args: deploy --stage production |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment