This action build a docker image using docker in docker then publish to ECR registries (primary and secondary).
name: Build docker image
on:
push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Get tag name
id: tag
run: echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/}
- uses: TheCloudConnectors/action-docker@master
env:
NPM_REGISTRY: ${{ secrets.NPM_REGISTRY }}
NPMRC: ${{ secrets.NPMRC }}
AWS_REGION: us-east-2
REGISTRY: 123456789
SECONDARY_REGISTRY: 987654321
REPOSITORY: example
DOCKERFILE: Dockerfile
CONTEXT: ./
TAG: ${{ steps.tag.outputs.SOURCE_TAG }}
Tag new version and publish release
git ci -am "v1"
git tag -a -m "Release notes" v1
git push --follow-tags