Skip to content

test: Fix MovieServiceTest + MovieControllerTest #20

test: Fix MovieServiceTest + MovieControllerTest

test: Fix MovieServiceTest + MovieControllerTest #20

Workflow file for this run

name: Docker Image CI
env:
AZURE_WEBAPP_NAME: movieland-backend # set this to your application's name
AZURE_WEBAPP_PACKAGE_PATH: './movieland-backend' # set this to the path to your web app project, defaults to the repository root
on:
push:
branches: [ master ]
jobs:
# Run Junit Tests of Backend
test:
name: 'Run Tests'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
name: 'Checkout repository'
- uses: actions/setup-java@v2
name: 'Backend - Setup Java 17'
with:
java-version: '17'
distribution: 'adopt'
- name: 'Backend - Run Tests'
run: mvn verify -DtmdbApi.apikey=${{ secrets.TMDB_API_KEY }}
working-directory: ./
# Build Docker images and push to Dockerhub
build-and-push-docker:
name: 'Build and Push'
runs-on: ubuntu-latest
needs: test
strategy:
fail-fast: false
matrix:
include:
- dockerfile: ./movieland-backend/Dockerfile
image: philkes/movie-land-backend
context: ./movieland-backend
- dockerfile: ./movieland-spring-admin/Dockerfile
image: philkes/movie-land-spring-admin
context: ./movieland-spring-admin
- dockerfile: ./movieland-frontend/Dockerfile
image: philkes/movie-land-frontend
context: ./movieland-frontend
permissions:
contents: read
packages: write
steps:
- name: 'Checkout repository'
uses: actions/checkout@v2
- name: 'Log in to the Container registry'
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: 'Extract metadata (tags, labels) for Docker'
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ matrix.image }}
- name: 'Build and push Docker images'
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: ${{ matrix.context }}
file: ${{ matrix.dockerfile }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
deploy-gh-page:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Use Node.js 12
uses: actions/setup-node@v3
with:
node-version: 12
- name: Install and Build 🔧 # This example project is built using npm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built.
working-directory: movieland-frontend
env:
REST_API_URL: ${{ secrets.BACKEND_URL }}/api
run: |
npm install
npm run generate
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: movieland-frontend/dist # The folder the action should deploy.
deploy-azure:
runs-on: ubuntu-latest
needs: build-and-push-docker
environment:
name: 'production'
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
steps:
- name: Deploy to Azure Web App
id: deploy-to-webapp
uses: azure/webapps-deploy@v2
with:
app-name: ${{ env.AZURE_WEBAPP_NAME }}
slot-name: 'production'
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
images: 'philkes/movie-land-backend:master'