diff --git a/.gitea/workflows/build-production.yaml b/.gitea/workflows/build-production.yaml index f146779..84acd53 100644 --- a/.gitea/workflows/build-production.yaml +++ b/.gitea/workflows/build-production.yaml @@ -52,6 +52,10 @@ jobs: gitea.perren.cloud/caperren/${{ needs.determine_version.outputs.repo_name }}:${{ needs.determine_version.outputs.repo_version_hash }} gitea.perren.cloud/caperren/${{ needs.determine_version.outputs.repo_name }}:${{ needs.determine_version.outputs.project_version }} gitea.perren.cloud/caperren/caperren-com:latest + build-args: | + REPO_VERSION_HASH=${{ needs.determine_version.outputs.repo_version_hash }} + PROJECT_VERSION=${{ needs.determine_version.outputs.project_version }} + BUILD_ENVIRONMENT=production test: runs-on: ubuntu-latest @@ -85,7 +89,7 @@ jobs: - name: Start App run: | curl -k -X 'POST' \ - 'https://caperren.com:444/api/v2.0/app/stop' \ + 'https://caperren.com:444/api/v2.0/app/start' \ -H 'accept: */*' \ -H 'Authorization: Bearer ${{ secrets.TRUENAS_CAPERRENCOM_API_KEY }}' \ -H 'Content-Type: application/json' \ diff --git a/.gitea/workflows/build-staging.yaml b/.gitea/workflows/build-staging.yaml index c05d138..a703610 100644 --- a/.gitea/workflows/build-staging.yaml +++ b/.gitea/workflows/build-staging.yaml @@ -50,6 +50,10 @@ jobs: push: true tags: | gitea.perren.cloud/caperren/caperren-com:latest-staging + build-args: | + REPO_VERSION_HASH=${{ needs.determine_version.outputs.repo_version_hash }} + PROJECT_VERSION=${{ needs.determine_version.outputs.project_version }} + BUILD_ENVIRONMENT=staging test: runs-on: ubuntu-latest @@ -72,6 +76,7 @@ jobs: "name": "caperren-com-stg", "options": {} }' + - name: Stop App run: | curl -k -X 'POST' \ @@ -83,7 +88,7 @@ jobs: - name: Start App run: | curl -k -X 'POST' \ - 'https://caperren.com:444/api/v2.0/app/stop' \ + 'https://caperren.com:444/api/v2.0/app/start' \ -H 'accept: */*' \ -H 'Authorization: Bearer ${{ secrets.TRUENAS_CAPERRENCOM_API_KEY }}' \ -H 'Content-Type: application/json' \ diff --git a/Dockerfile b/Dockerfile index 551a47c..01cd830 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,7 +12,14 @@ FROM base AS build-deps RUN npm install FROM build-deps AS build + COPY . . + +ARG REPO_VERSION_HASH +ARG PROJECT_VERSION + +RUN echo $"PUBLIC_REPO_VERSION_HASH=${REPO_VERSION_HASH} \n\ + PUBLIC_PROJECT_VERSION=${PROJECT_VERSION}" >> .env RUN npm run build FROM httpd:latest AS runtime