Skip to content

Commit

Permalink
production_git_action_yml_update
Browse files Browse the repository at this point in the history
  • Loading branch information
Lungsangg committed Jul 16, 2024
1 parent 51906e9 commit 622bd1b
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/docker-image-production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Docker Publish Trigger

on:
push:
branches:
- production-master # Change this to your main branch name, e.g., master

jobs:
build-and-publish:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Login to GitHub Container Registry
run: echo ${{ secrets.PECHA_TOKEN }} | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin

- name: Set Env Variables in lowecase
run: |
echo "OWNER_LC=${OWNER,,}" >> ${GITHUB_ENV}
echo "REPOSITORY_LC=${REPOSITORY,,}" >> ${GITHUB_ENV}
env:
OWNER: '${{ github.repository_owner }}'
REPOSITORY: '${{ github.repository }}'

- name: Build Docker image
run: docker build -t ghcr.io/${{ env.OWNER_LC }}/${{ env.REPOSITORY_LC }}:${{ github.sha }} . && docker tag ghcr.io/${{ env.OWNER_LC }}/${{ env.REPOSITORY_LC }}:${{ github.sha }} ghcr.io/${{ env.OWNER_LC }}/${{ env.REPOSITORY_LC }}:latest


- name: Push Docker image
run: docker push ghcr.io/${{ env.OWNER_LC }}/${{ env.REPOSITORY_LC }}:${{ github.sha }} && docker push ghcr.io/${{ env.OWNER_LC }}/${{ env.REPOSITORY_LC }}:latest

- name: Deploy to render
run: curl -X POST ${{ secrets.DEPLOY_HOOK_NOTIFICATION }}ghcr.io/${{ env.OWNER_LC }}/${{ env.REPOSITORY_LC }}:${{ github.sha }}

0 comments on commit 622bd1b

Please sign in to comment.