mirror of
https://github.com/UniversityOfHelsinkiCS/ohtuilmo.git
synced 2026-10-12 19:03:41 +03:00
53 lines
1.6 KiB
YAML
53 lines
1.6 KiB
YAML
name: Deploy to production
|
|
|
|
on:
|
|
release:
|
|
types: [published]
|
|
|
|
jobs:
|
|
build-and-push:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Build backend
|
|
id: build-backend
|
|
uses: redhat-actions/buildah-build@v2
|
|
with:
|
|
image: ohtuilmo-backend
|
|
tags: production ${{ github.sha }}
|
|
context: backend/
|
|
containerfiles: |
|
|
backend/Dockerfile
|
|
build-args: NODE_ENV="production"
|
|
|
|
- name: Build frontend
|
|
id: build-frontend
|
|
uses: redhat-actions/buildah-build@v2
|
|
with:
|
|
image: ohtuilmo-frontend
|
|
tags: production ${{ github.sha }}
|
|
context: frontend/
|
|
containerfiles: |
|
|
frontend/Dockerfile
|
|
build-args: NODE_ENV="production"
|
|
|
|
- name: Push backend to registry.version.helsinki.fi
|
|
uses: redhat-actions/push-to-registry@v2
|
|
with:
|
|
image: ${{ steps.build-backend.outputs.image }}
|
|
tags: ${{ steps.build-backend.outputs.tags }}
|
|
registry: registry.version.helsinki.fi/toska/openshift/kontit/
|
|
username: kontit
|
|
password: ${{ secrets.VERSION_PUSH_SECRET }}
|
|
|
|
- name: Push frontend to registry.version.helsinki.fi
|
|
uses: redhat-actions/push-to-registry@v2
|
|
with:
|
|
image: ${{ steps.build-frontend.outputs.image }}
|
|
tags: ${{ steps.build-frontend.outputs.tags }}
|
|
registry: registry.version.helsinki.fi/toska/openshift/kontit/
|
|
username: kontit
|
|
password: ${{ secrets.VERSION_PUSH_SECRET }}
|