Skip to content

Commit

Permalink
feat: publish docker images
Browse files Browse the repository at this point in the history
Publish Docker images into public AWS ECR.
  • Loading branch information
Joona Oikarinen committed Mar 22, 2022
1 parent b8c2a92 commit ca1da99
Showing 1 changed file with 37 additions and 2 deletions.
39 changes: 37 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,44 @@ jobs:
name: next_result
path: ./next_result.txt

release:
release-docker:
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
name: Publish
name: Publish Docker image
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.6
- name: Configure AWS credentials
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
role-external-id: ${{ secrets.EXTERNAL_ID }}
role-duration-seconds: 1200
role-session-name: GithubAction
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Build, tag, and push image to Amazon ECR
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: ivves/change-analyzer
IMAGE_TAG: ${{ github.sha }}
run: |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
release-pypi:
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
name: Publish PyPI package
needs: test
runs-on: ubuntu-latest
steps:
Expand Down

0 comments on commit ca1da99

Please sign in to comment.