[Workflow: Build] Add backend url env

This commit is contained in:
ShootingStar91
2024-08-02 13:23:08 +03:00
parent 026274e347
commit eaba79fc3a
+8 -1
View File
@@ -5,6 +5,7 @@ env:
BACKEND_IMAGE_NAME: nowdb-backend
FRONTEND_IMAGE_NAME: nowdb-frontend
jobs:
push_backend:
runs-on: ubuntu-latest
@@ -26,10 +27,13 @@ jobs:
# This changes all uppercase characters to lowercase.
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
# This strips the git ref prefix from the version.
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# This strips the "v" prefix from the tag name.
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
VERSION=latest
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
@@ -42,8 +46,11 @@ jobs:
contents: read
steps:
- uses: actions/checkout@v4
- name: Build image
env:
VITE_BACKEND_URL: ${{ secrets.BACKEND_URL }}
run: docker build frontend --tag $FRONTEND_IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}"
- name: Log in to registry