Configure Renovate #50
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: Create and publish a Docker image to ECR | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- 'README.md' | |
- 'terraform/**' | |
pull_request: | |
paths-ignore: | |
- 'README.md' | |
- 'terraform/**' | |
env: | |
IMAGE_NAME: ${{ github.repository }} | |
AWS_REGION: us-east-1 | |
jobs: | |
build-and-push: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Dump GitHub context | |
env: | |
GITHUB_CONTEXT: ${{ toJSON(github) }} | |
run: echo "$GITHUB_CONTEXT" | |
- name: Check out code | |
uses: actions/checkout@v2 | |
- 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: ${{ env.AWS_REGION }} | |
- name: Login to Amazon ECR | |
id: login-ecr | |
uses: aws-actions/amazon-ecr-login@v1 | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v3 | |
env: | |
ECR_IMAGE: ${{ steps.login-ecr.outputs.registry }}/${{ env.IMAGE_NAME }} | |
with: | |
images: | | |
${{ env.ECR_IMAGE }} | |
tags: | | |
type=sha | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
# - name: Download task definition | |
# run: | | |
# aws ecs describe-task-definition --task-definition ${{ env.AWS_REGION }}-nginx-rtmp --query taskDefinition | \ | |
# jq "del(.compatibilities,.taskDefinitionArn,.requiresAttributes,.revision,.status,.registeredAt,.registeredBy)" \ | |
# > task-definition.json | |
# - name: Fill in the new image ID in the Amazon ECS task definition | |
# id: task-def | |
# uses: aws-actions/amazon-ecs-render-task-definition@v1 | |
# with: | |
# task-definition: task-definition.json | |
# container-name: rtmp | |
# image: ${{ steps.meta.outputs.tags }} | |
# - name: Deploy Amazon ECS task definition | |
# if: github.event_name == 'push' | |
# uses: aws-actions/amazon-ecs-deploy-task-definition@v1 | |
# with: | |
# task-definition: ${{ steps.task-def.outputs.task-definition }} | |
# service: ${{ env.AWS_REGION }}-nginx-rtmp | |
# cluster: rtmp | |
# wait-for-service-stability: true |