Skip to content

Update dev.yml

Update dev.yml #122

Workflow file for this run

name: Docker CI/CD
on:
push:
branches: [ "dev" ]
env:
REGISTRY: ghcr.io
IMAGE_NAME_BACKEND: ${{ github.repository }}-backend
IMAGE_NAME_FRONTEND: ${{ github.repository }}-frontend
jobs:
build-backend:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
run: |
docker build --pull -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_BACKEND }}-backend:latest -f backend.Dockerfile .
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_BACKEND }}-backend:latest
build-frontend:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
run: |
docker build --pull -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_FRONTEND }}-frontend:latest -f frontend.Dockerfile .
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_FRONTEND }}-frontend:latest