-
Notifications
You must be signed in to change notification settings - Fork 4
52 lines (41 loc) · 1.35 KB
/
Copy pathcd.yml
File metadata and controls
52 lines (41 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: CD
on:
workflow_call:
secrets:
AWS_ACCESS_KEY_ID:
required: true
AWS_SECRET_ACCESS_KEY:
required: true
ROLLBAR_ACCESS_TOKEN:
required: true
workflow_dispatch:
permissions:
packages: write
jobs:
push:
runs-on: ubuntu-latest
environment: Production
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: gearbox
path: /tmp
- name: Load image
run: |
docker load --input /tmp/gearbox.tar
docker image ls -a
- name: Sign in to GHCR
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u decatur-robotics --password-stdin
- name: Push to GHCR
run: docker push ghcr.io/decatur-robotics/gearbox:latest
- name: Install AWS CLI
uses: unfor19/install-aws-cli-action@v1
- name: Configure AWS
run: aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }} && aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }} && aws configure set region us-east-1
- name: Deploy to ECS
run: aws ecs update-service --cluster gearbox --service gearbox --force-new-deployment