Skip to content

chore: add log

chore: add log #10

Workflow file for this run

name: Build and Deploy to Cloud Run
on:
push:
branches:
- debug
- master
pull_request:
branches:
- master
env:
REGISTRY: ghcr.io
IMAGE_NAME: "davidh16/github-actions-with-coolify"
jobs:
deploy:
environment:
name: ${{ github.ref == 'refs/heads/master' && 'production' || 'debug' }}
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- name: Login to ghcr.io
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Create .env file from vars
run: |
echo "Generating .env file from vars..."
touch .env
for var in $(echo '${{ toJSON(vars) }}' | jq -r 'to_entries|map("\(.key)=\(.value|tostring)")|.[]'); do
echo "$var" >> .env
done
echo ".env file generated:"
cat .env
- name: Build image and push to registry
uses: docker/build-push-action@v4
with:
context: .
file: Dockerfile
platforms: linux/amd64
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
- name: Deploy to Coolify
run: |
curl --request GET '${{ secrets.COOLIFY_WEBHOOK }}' --header 'Authorization: Bearer ${{ secrets.COOLIFY_TOKEN }}'