Skip to content

CW permissions

CW permissions #21

Workflow file for this run

name: Publish Docker image
on:
push:
branches:
- main
jobs:
buid_and_publush_dockergiot :
name: Push Docker image to ECR
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Build and push Docker image
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
aws ecr get-login-password --region eu-west-1 | docker login --username AWS --password-stdin 244530008913.dkr.ecr.eu-west-1.amazonaws.com
rev=$(git rev-parse --short HEAD)
docker build . -t hello
docker tag hello 244530008913.dkr.ecr.eu-west-1.amazonaws.com/vincent-ppe:$rev
docker tag hello 244530008913.dkr.ecr.eu-west-1.amazonaws.com/vincent-ppe:latest
docker push 244530008913.dkr.ecr.eu-west-1.amazonaws.com/vincent-ppe:$rev
docker push 244530008913.dkr.ecr.eu-west-1.amazonaws.com/vincent-ppe:latest