Skip to content

Dev (#377)

Dev (#377) #103

name: Docker Publish Trigger
on:
push:
branches:
- staging # 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: Install dependencies
run: |
pip install python-bidi
- 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_STAGING }}ghcr.io/${{ env.OWNER_LC }}/${{ env.REPOSITORY_LC }}:${{ github.sha }}