Skip to content

extract backend url to variable (#197) #174

extract backend url to variable (#197)

extract backend url to variable (#197) #174

Workflow file for this run

name: release
on:
push:
branches:
- 'main'
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Display build number
run: |
echo "Build number: ${{ github.run_number }}"
- name: Increment patch version
id: increment_patch_version
run: |
git fetch --tags
latestTag=$(git describe --tags `git rev-list --tags --max-count=1`)
if [[ $latestTag == pre_v* ]]; then
newTag="${latestTag#pre_v}"
else
IFS='.' read -ra parts <<< "${latestTag//v/}"
major=${parts[0]}
minor=${parts[1]}
patch=${parts[2]}
patch=$((patch+1))
newTag="$major.$minor.$patch"
fi
echo "newTag=$newTag" >> $GITHUB_ENV
- name: Create patch tag
id: create_patch_tag
run: |
git config user.name "GitHub Actions"
git config user.email "[email protected]"
git tag -a v${{ env.newTag }} -m "Release v${{ env.newTag }}"
git push origin v${{ env.newTag }}
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push Docker backend image
uses: docker/build-push-action@v5
with:
context: .
file: ./backend/Dockerfile
push: true
tags: retypeme/retypeme-backend:${{ env.newTag }}, retypeme/retypeme-backend:latest
build-args: |
REPOSITORY_TOKEN=${{ secrets.REPOSITORY_TOKEN }}
- name: Build and push Docker frontend image
uses: docker/build-push-action@v5
with:
context: ./frontend
file: ./frontend/Dockerfile
push: true
tags: retypeme/retypeme-frontend-uat:${{ env.newTag }}, retypeme/retypeme-frontend-uat:latest
build-args: |

Check failure on line 70 in .github/workflows/release.yml

View workflow run for this annotation

GitHub Actions / release

Invalid workflow file

The workflow is not valid. .github/workflows/release.yml (Line: 70, Col: 23): Unrecognized named-value: 'secret'. Located at position 1 within expression: secret.NEXT_PUBLIC_API_DOMAIN_UAT .github/workflows/release.yml (Line: 81, Col: 23): Unrecognized named-value: 'secret'. Located at position 1 within expression: secret.NEXT_PUBLIC_API_DOMAIN_PROD
NEXT_PUBLIC_ENV_LOCAL_INFURA_AMOY_API_KEY=${{ secrets.NEXT_PUBLIC_ENV_LOCAL_INFURA_AMOY_API_KEY }}
NEXT_PUBLIC_API_DOMAIN=${{ secret.NEXT_PUBLIC_API_DOMAIN_UAT }}
- name: Build and push Docker frontend image
uses: docker/build-push-action@v5
with:
context: ./frontend
file: ./frontend/Dockerfile
push: true
tags: retypeme/retypeme-frontend-prod:${{ env.newTag }}, retypeme/retypeme-frontend-prod:latest
build-args: |
NEXT_PUBLIC_ENV_LOCAL_INFURA_AMOY_API_KEY=${{ secrets.NEXT_PUBLIC_ENV_LOCAL_INFURA_AMOY_API_KEY }}
NEXT_PUBLIC_API_DOMAIN=${{ secret.NEXT_PUBLIC_API_DOMAIN_PROD }}