fix duplicates in filter bar #923
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
jobs: | |
ci: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Build Docker | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SRM_DEVOPS_DEPLOY_KEY: ${{ secrets.SRM_DEVOPS_DEPLOY_KEY }} | |
IMAGE_NAME: srm-frontend | |
CHART_NAME: site | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
run: | | |
if [[ "${GITHUB_REF}" =~ ^refs/tags/.* ]]; then | |
TAG_NAME="${GITHUB_REF/refs\/tags\//}" | |
ENV_NAME="production" | |
SENTRY_ARG="--build-arg SENTRY_AUTH_TOKEN=${SENTRY_AUTH_TOKEN}" | |
else | |
TAG_NAME="" | |
ENV_NAME="staging" | |
SENTRY_ARG="--build-arg SENTRY_AUTH_TOKEN=" | |
fi | |
BUILD_ARGS="" | |
if docker pull "ghcr.io/kolzchut/${IMAGE_NAME}:latest"; then | |
BUILD_ARGS="--cache-from ghcr.io/kolzchut/${IMAGE_NAME}:latest" | |
fi | |
env > saved_env &&\ | |
docker build -t api $BUILD_ARGS --build-arg ENV_NAME=$ENV_NAME $SENTRY_ARG . &&\ | |
echo "${GITHUB_TOKEN}" | docker login https://ghcr.io -u kolzchut --password-stdin &&\ | |
if [ "${GITHUB_REF}" == "refs/heads/main" ] || [ "${TAG_NAME}" != "" ]; then | |
echo "${SRM_DEVOPS_DEPLOY_KEY}" > srm_devops_deploy_key &&\ | |
chmod 400 srm_devops_deploy_key &&\ | |
export GIT_SSH_COMMAND="ssh -i $(pwd)/srm_devops_deploy_key -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" &&\ | |
git clone [email protected]:kolzchut/srm-devops.git &&\ | |
git config --global user.name "srm-devops CI" &&\ | |
git config --global user.email "srm-devops-ci@localhost" &&\ | |
cd srm-devops &&\ | |
VALUES_AUTO_UPDATED_FILE="helm/${CHART_NAME}/values.auto-updated.yaml" &&\ | |
IMAGE="ghcr.io/kolzchut/${IMAGE_NAME}:${GITHUB_SHA}" &&\ | |
if [ "${TAG_NAME}" != "" ]; then | |
VALUES_AUTO_UPDATED_FILE="helm/${CHART_NAME}/values.auto-updated.production.yaml" &&\ | |
IMAGE="ghcr.io/kolzchut/${IMAGE_NAME}:${TAG_NAME}-${GITHUB_SHA}" | |
fi &&\ | |
docker tag api "${IMAGE}" &&\ | |
docker push "${IMAGE}" &&\ | |
bin/update_yaml.py '{"'"${CHART_NAME}"'":{"image":"'"${IMAGE}"'"}}' "${VALUES_AUTO_UPDATED_FILE}" &&\ | |
git add "${VALUES_AUTO_UPDATED_FILE}" &&\ | |
git commit -m "update image: ${VALUES_AUTO_UPDATED_FILE}" &&\ | |
git push origin main | |
fi &&\ | |
if [ "${GITHUB_REF}" == "refs/heads/main" ]; then | |
docker tag api "ghcr.io/kolzchut/${IMAGE_NAME}:latest" &&\ | |
docker push "ghcr.io/kolzchut/${IMAGE_NAME}:latest" | |
fi |