extract backend url to variable (#197) #174
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: 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 GitHub Actions / releaseInvalid workflow file
|
||
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 }} |