Skip to content

small change #314

small change

small change #314

name: Docker Publish Trigger
on:
push:
branches:
- dev # 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: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Deploy to render
run: curl -X POST ${{ secrets.DEPLOY_HOOK_NOTIFICATION_DEV }}ghcr.io/${{ env.OWNER_LC }}/${{ env.REPOSITORY_LC }}:${{ github.sha }}