Skip to content

More permissions and changes to endorsement group creation. #155

More permissions and changes to endorsement group creation.

More permissions and changes to endorsement group creation. #155

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:
prettier:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
- name: Prettify Code
uses: actionsx/prettier@v2
with:
args: --write .
build-backend:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
# Log in to the Container registry
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Build and push Backend Docker image
- name: Build and push docker images
run: |
docker build --pull -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_BACKEND }}:latest -f backend.Dockerfile .
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_BACKEND }}:latest
build-frontend:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
# Log in to the Container registry
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Build and push Frontend Docker image
- name: Build and push docker images
run: |
docker build --pull -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_FRONTEND }}:latest -f frontend.Dockerfile .
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_FRONTEND }}:latest