-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (31 loc) · 1.2 KB
/
docker-image-lightsail.yml
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
name: Docker Image deploy to AWS Lightsail
on:
workflow_dispatch:
# These permissions are needed to interact with GitHub's OIDC Token endpoint.
permissions:
id-token: write
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build the Docker image
run: docker build -t dash-example:latest .
- name: Configure AWS credentials from my account
uses: aws-actions/configure-aws-credentials@v2
with:
# Get role ARN from AWS IAM console
role-to-assume: arn:aws:iam::512081954320:role/lightsail-deploy
aws-region: eu-west-2
role-session-name: MySessionName
- name: Install AWS Lightsail plugin
shell: bash
run: |
curl "https://s3.us-west-2.amazonaws.com/lightsailctl/latest/linux-amd64/lightsailctl" -o "/usr/local/bin/lightsailctl"
sudo chmod +x /usr/local/bin/lightsailctl
- name: Push image to Lightsail
# Note. This will not deploy. Use the AWS console to replace any existing deployment.
shell: bash
run: |
aws lightsail push-container-image --region eu-west-2 --service-name container-service-1 --image dash-example:latest --label dash-example