Skip to content

Merge pull request #40 from EPFL-ENAC/dev #31

Merge pull request #40 from EPFL-ENAC/dev

Merge pull request #40 from EPFL-ENAC/dev #31

Workflow file for this run

---
# https://github.com/EPFL-ENAC/github-actions-runner#readme
name: deploy-prod
"on":
push:
branches:
- main
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-push-image:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- Dockerfile: ./s3_server/Dockerfile
context: ./s3_server
image: ghcr.io/epfl-enac/alice-ethz-arema-s3_server
- Dockerfile: ./uploadFASTAPI/Dockerfile
context: ./uploadFASTAPI
image: ghcr.io/epfl-enac/alice-ethz-arema-uploadfastapi
- Dockerfile: ./backend/Dockerfile
context: ./backend
image: ghcr.io/epfl-enac/alice-ethz-arema-backend
- Dockerfile: ./admin/Dockerfile
context: ./admin
image: ghcr.io/epfl-enac/alice-ethz-arema-admin
- Dockerfile: ./frontend/Dockerfile
context: ./frontend
image: ghcr.io/epfl-enac/alice-ethz-arema-frontend
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ matrix.image }}
- name: Build and push Docker image EPFL-ENAC.Agent.Service
uses: docker/build-push-action@v5
with:
context: ${{ matrix.context }}
push: true
build-args: |
"API_PATH=${{ secrets.API_PATH }}"
"API_URL=${{ secrets.API_URL }}"
file: ${{ matrix.dockerfile }}
tags: ${{ steps.meta.outputs.tags }},${{ matrix.image }}:${{ github.sha }},${{ matrix.image }}:latest
labels: ${{ steps.meta.outputs.labels }}
deploy:
needs: build-and-push-image
runs-on: ubuntu-latest
steps:
- uses: EPFL-ENAC/epfl-enac-deploy-action@main
with:
ENAC_IT4R_CD_environment: "prod"
ENAC_IT4R_CD_deployment_id: ${{ secrets.CD_PROD_ID }}
ENAC_IT4R_CD_deployment_secret: ${{ secrets.CD_PROD_SECRET }}
timeout: "1000"