Skip to content

Instantly share code, notes, and snippets.

@alsmola
Created May 8, 2022 18:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alsmola/8125d36673312b7cfb7dd85155d1874b to your computer and use it in GitHub Desktop.
Save alsmola/8125d36673312b7cfb7dd85155d1874b to your computer and use it in GitHub Desktop.
GitHub Action configuration to deploy to AWS via OIDC and Serverless
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