Skip to content

Commit

Permalink
proconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin PILIA committed Nov 15, 2024
1 parent 7efc25e commit cc3ffb4
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ on:
push:
branches:
- main
- proconnect


env:
IMAGE_NAME: ghcr.io/${{ github.repository }}/frontend
IMAGE_TAG: ${{ github.sha }}

# TODO: add tests
# Gitlab old code:
Expand Down Expand Up @@ -48,13 +54,19 @@ jobs:
build-and-push:
name: Build and push from ${{ github.ref_name }}/${{ github.sha }}
runs-on: ubuntu-latest
outputs:
commit_title: ${{ steps.get_head_commit_title.outputs.title }}
env:
IMAGE_NAME: ghcr.io/${{ github.repository }}/api
IMAGE_TAG: ${{ github.sha }}
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Get last commit title
id: get_head_commit_title
run: echo "title=$(git log --format=%B -n 1 HEAD | head -n 1)" >> $GITHUB_OUTPUT

- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
Expand All @@ -71,14 +83,15 @@ jobs:
context: ./api
file: ./api/Dockerfile
push: true
tags: ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }},${{ env.IMAGE_NAME }}:latest
tags: ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }},${{ env.IMAGE_NAME }}:${{github.ref_name}}-latest
cache-from: type=gha
cache-to: type=gha,mode=max

deploy-dev:
name: Deploy from ${{ github.ref_name }}/${{ github.sha }}
runs-on: ubuntu-latest
needs: build-and-push
if: github.ref_name == 'dev'
steps:
- name: Trigger dev deployment
run: |
Expand Down

0 comments on commit cc3ffb4

Please sign in to comment.