diff --git a/.dockerignore b/.dockerignore index 53ee560..e92ad8f 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,4 +1,6 @@ Dockerfile .dockerignore LICENSE -.git* \ No newline at end of file +.git* +.env +.gitignore \ No newline at end of file diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 33b3fbc..bbcaca4 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -39,11 +39,10 @@ jobs: - name: Fetch remote repository id: fetch_version run: | - apt-get install -y jq - if [[ ${{ gitea.ref_name }} == 'latest' ]]; do \ - export VERSION=$(curl -sfL https://api.github.com/repos/AmruthPillai/Reactive-Resume/releases/latest | jq .tag_name -r); \ - else \ - export VERSION=${{ gitea.ref_name }}; \ + if [[ ${{ gitea.ref_name }} == 'latest' ]]; then + export VERSION=$(curl -sfL https://api.github.com/repos/AmruthPillai/Reactive-Resume/releases/latest | jq .tag_name -r) + else + export VERSION=${{ gitea.ref_name }} fi git clone --depth 1 --branch $VERSION https://github.com/AmruthPillai/Reactive-Resume.git app @@ -57,7 +56,9 @@ jobs: context: . push: true cache-to: type=inline - cache-from: type=registry,ref=${{ env.REPOSITORY}} + cache-from: | + type=registry,ref=${{ env.REPOSITORY}}:latest + type=registry,ref=${{ env.HOSTNAME }}/${{ env.REPOSITORY }}:latest tags: | ${{ env.REPOSITORY }}:${{ steps.get_version.outputs.version }} ${{ env.REPOSITORY }}:latest diff --git a/.gitignore b/.gitignore index 7a0b7f0..f8ed1cb 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -app \ No newline at end of file +app +.env \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh index 320a5b0..9ca9cdb 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -4,6 +4,8 @@ if [ ! -f .env ]; then cp /data/.env.template .env fi -export $(grep -v '^#' .env | xargs) +set -a +source .env +set +a exec "$@" \ No newline at end of file