Merge pull request #4 from CS3219-AY2324S1/deployment-init #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Docker Images | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
env: | |
FRONTEND_IMAGE_NAME: peerprep-frontend | |
NGINX_IMAGE_NAME: peerprep-nginx | |
jobs: | |
build-frontend-image: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Check out Source | |
uses: actions/checkout@v2 | |
- name: Log in to the Container Registry | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ay2324s1-course-assessment-g21 | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and Push Docker Image | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
file: deployment/Dockerfile-frontend | |
push: true | |
tags: ghcr.io/ay2324s1-course-assessment-g21/${{ env.FRONTEND_IMAGE_NAME }}:latest | |
build-nginx-image: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Check out Source | |
uses: actions/checkout@v2 | |
- name: Log in to the Container Registry | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ay2324s1-course-assessment-g21 | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and Push Docker Image | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
file: deployment/Dockerfile-nginx | |
push: true | |
tags: ghcr.io/ay2324s1-course-assessment-g21/${{ env.NGINX_IMAGE_NAME }}:latest |