Merge pull request #128 from mercedes-benz/develop #20
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: Test/Deploy Production | |
on: | |
push: | |
branches: [production] | |
jobs: | |
build: | |
name: Build Docker Image from Production Branch | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [18.x] | |
steps: | |
- name: Checkout Production Branch | |
uses: actions/checkout@v2 | |
# - name: Use Node.js ${{ matrix.node-version }} | |
# uses: actions/setup-node@v1 | |
# with: | |
# node-version: ${{ matrix.node-version }} | |
# - name: Creating Neo4j Container | |
# run: | | |
# chmod +x ./scripts/docker-neo4j-initializer/docker-neo4j.sh | |
# ./scripts/docker-neo4j-initializer/docker-neo4j.sh | |
# sleep 30s | |
# chmod +x ./scripts/docker-neo4j-initializer/start-movies-db.sh | |
# ./scripts/docker-neo4j-initializer/start-movies-db.sh | |
# - run: yarn install | |
# - name: Eslint check | |
# run: yarn run lint | |
# - name: Run Cypress Tests | |
# uses: cypress-io/github-action@v4 | |
# with: | |
# build: yarn run build | |
# start: yarn run dev | |
# wait-on: 'http://localhost:3000' | |
# browser: chrome | |
- name: Removing Docs Folder | |
run: rm -rf docs | |
# - name: 'Azure ACR Login' | |
# uses: azure/docker-login@v1 | |
# with: | |
# login-server: ${{ secrets.REGISTRY_LOGIN_SERVER }} | |
# username: ${{ secrets.REGISTRY_USERNAME }} | |
# password: ${{ secrets.REGISTRY_PASSWORD }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Populate Docker Metadata | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: | | |
updatepath.azurecr.io/neodash-mbenz | |
tags: | | |
type=ref, event=branch | |
type=sha | |
- name: Azure Container Registry Login | |
uses: docker/login-action@v2 | |
with: | |
registry: updatepath.azurecr.io | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Build and Push to ACR | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
push: true | |
file: ./Dockerfile | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max |