add vapor implementation #12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Vapor image to ECR | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
publish: | |
name: Publish Vapor Image | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@57396166ad8aefe6098280995947635806a0e6ea | |
with: | |
images: | | |
name=bookstore-vapor | |
tags: | | |
# minimal (short sha) | |
type=sha | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v1-node16 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: eu-west-1 | |
- name: Login to Amazon ECR | |
id: login-ecr | |
uses: aws-actions/amazon-ecr-login@261a7de32bda11ba01f4d75c4ed6caf3739e54be | |
- name: Build, tag, and push image to Amazon ECR | |
env: | |
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} | |
ECR_REPOSITORY: bookstore-vapor | |
IMAGE_TAGS: ${{ steps.meta.outputs.tags }} | |
run: | | |
docker build -t $ECR_REGISTRY/$IMAGE_TAGS -t $ECR_REGISTRY/$ECR_REPOSITORY . | |
docker push -a $ECR_REGISTRY/$ECR_REPOSITORY | |
working-directory: ./bookstore-vapor |