Skip to content

Add rating constants (because I need it for training, and I'd rather … #7

Add rating constants (because I need it for training, and I'd rather …

Add rating constants (because I need it for training, and I'd rather … #7

Workflow file for this run

name: Build
on:
push:
branches: ["main"] # Add "main" here when ready
jobs:
build:
name: Build and push Docker image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set Tag in env variable
run: |
echo "sha_short=$(echo ${{ github.sha }} | cut -c1-7)" >> $GITHUB_ENV
echo "${{ secrets.DOCKER_USER }}/${{ secrets.REPOSITORY_NAME }}" > APP_NAME
echo "$GITHUB_SHA" > TAG
- name: Build the Docker image
run: docker build . --file ./deploy/docker/Dockerfile --tag $(cat APP_NAME):${{ github.sha }}
- name: Tag the image to commit
run: docker tag $(cat APP_NAME):${{ github.sha }} $(cat APP_NAME):${{ github.sha }}
- name: Docker Login
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASS }}
- name: Image push
run: docker push $(cat APP_NAME):${{ github.sha }}
# deploy-dev:
# name: Deploy dev to ArgoCD
# runs-on: ubuntu-latest
# needs: build
# steps:
# - name: Check out the repo
# uses: actions/checkout@v4
# with:
# repository: 'VATUSA/gitops'
# path: gitops
# token: ${{ secrets.G_TOKEN }}
# - name: Setup Kustomize
# uses: imranismail/setup-kustomize@v2
# - name: Update manifests
# run: |
# cd $GITHUB_WORKSPACE/deploy/gitops/overlays/dev
# kustomize edit set image ${{ secrets.DOCKER_USER }}/${{ secrets.REPOSITORY_NAME }}=${{ secrets.DOCKER_USER }}/${{ secrets.REPOSITORY_NAME }}:${{ github.sha }}
# - name: Commit and push changes
# run: |
# cd $GITHUB_WORKSPACE/gitops
# git config --global user.email "vatusa6@vatusa.net"
# git config --global user.name "VATUSA6"
# echo ${{ github.sha }}
# git add .
# git commit -m "Update primary-api image tag to ${{ github.sha }}"
# - name: Push to gitops repo
# run: |
# cd $GITHUB_WORKSPACE/gitops
# git push origin main
# deploy:
# name: Deploy prod to ArgoCD
# runs-on: ubuntu-latest
# needs: deploy-dev
# steps:
# - name: Check out the repo
# uses: actions/checkout@v4
# with:
# repository: 'VATUSA/gitops'
# path: gitops
# token: ${{ secrets.G_TOKEN }}
# - name: Setup Kustomize
# uses: imranismail/setup-kustomize@v2
# - name: Update manifests
# run: |
# cd $GITHUB_WORKSPACE/gitops/overlays/prod
# kustomize edit set image ${{ secrets.DOCKER_USER }}/${{ secrets.REPOSITORY_NAME }}=${{ secrets.DOCKER_USER }}/${{ secrets.REPOSITORY_NAME }}:${{ github.sha }}
# - name: Commit and push changes
# run: |
# cd $GITHUB_WORKSPACE/gitops
# git config --global user.email "vatusa6@vatusa.net"
# git config --global user.name "VATUSA6"
# echo ${{ github.sha }}
# git add .
# git commit -m "Update primary-api image tag to ${{ github.sha }}"
# - name: Push to gitops repo
# run: |
# cd $GITHUB_WORKSPACE/gitops
# git push origin main