Skip to content

Commit

Permalink
chore(workflow): test build push and update value
Browse files Browse the repository at this point in the history
  • Loading branch information
EchoSkorJjj committed Apr 28, 2024
1 parent 42430f0 commit 2eeb00d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
22 changes: 19 additions & 3 deletions .github/workflows/contents.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches:
- main
- feat/build-push
- chore/build-push
paths:
- 'backend/simple/contents/**'

Expand Down Expand Up @@ -35,5 +35,21 @@ jobs:
context: ./backend/simple/contents/
file: ./backend/simple/contents/Contents.Dockerfile
push: true
tags: ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/${{ secrets.ECR_REPOSITORY }}:contents
platforms: linux/arm64
tags: ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/${{ secrets.ECR_REPOSITORY }}:contents-${{ github.sha }}
platforms: linux/arm64

- name: Clone deployment repository
uses: actions/checkout@v3
with:
repository: ${{ secrets.DEPLOYMENT_REPO }}
token: ${{ secrets.DEPLOYMENT_REPO_TOKEN }}
path: 'deployment-repo'

- name: Update Kubernetes deployment image
run: |
cd deployment-repo
sed -i 's|image: .*|image: ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/${{ secrets.ECR_REPOSITORY }}:contents-${{ github.sha }}|' ./kubernetes/simple/contents/contents-deployment.yaml
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git commit -am "Update image tag to ${{ github.sha }}"
git push
3 changes: 2 additions & 1 deletion backend/simple/contents/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ def main():
dotenv.load_dotenv()
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')

main()
main()

0 comments on commit 2eeb00d

Please sign in to comment.