Skip to content

Instantly share code, notes, and snippets.

@danecando
Created May 22, 2022 23:45
Show Gist options
  • Save danecando/cd1e179d54a7cb55873f239f438fe6e3 to your computer and use it in GitHub Desktop.
Save danecando/cd1e179d54a7cb55873f239f438fe6e3 to your computer and use it in GitHub Desktop.
GitHub Action: Deploy AWS Fargate app with AWS Copilot
deploy:
name: 🚀 Deploy
runs-on: ubuntu-latest
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.9.1
- name: ⬇️ Checkout repo
uses: actions/checkout@v3
- name: 🔐 Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-2
- name: 🧑‍✈️ Setup AWS Copilot
uses: Tipser/setup-aws-copilot@v2
- name: 🎭 Deploy Staging
if: ${{ github.ref == 'refs/heads/staging' }
run: copilot svc deploy -n [app-name] --env staging
- name: 🪖 Deploy Proudction
if: ${{ github.ref == 'refs/heads/main' }}
run: copilot svc deploy -n [app-name] --env production
@VaZark
Copy link

VaZark commented Jan 4, 2023

This is pretty cool. I ended up stealing this for my repo.

However, I am stuck with an authentication error as the copilot command returns AccessDeniedException: User: arn:aws:iam::***:user/autobot-test is not authorized to perform: ssm:GetParameter on resource:

Any idea what could be the issue ? I've tested with an admin IAM user and still no dice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment