Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions .github/workflows/deploy-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Production deployment

on:
push:
branches:
- main

env:
AZURE_RESOURCE_GROUP: cd-with-actions
AZURE_APP_PLAN: actions-ttt-deployment
AZURE_LOCATION: '"Central US"'
AZURE_WEBAPP_NAME: piraces-ttt-app

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: npm install and build webpack
run: |
npm install
npm run build
- uses: actions/upload-artifact@main
with:
name: webpack artifacts
path: public/

Build-Docker-Image:
runs-on: ubuntu-latest
needs: build
name: Build image and store in GitHub Packages
steps:
- name: Checkout
uses: actions/checkout@v1

- name: Download built artifact
uses: actions/download-artifact@main
with:
name: webpack artifacts
path: public

- name: create image and store in Packages
uses: mattdavis0351/actions/docker-gpr@1.3.0
with:
repo-token: ${{secrets.GITHUB_TOKEN}}
image-name: ${{env.DOCKER_IMAGE_NAME}}

Deploy-to-Azure:
runs-on: ubuntu-latest
needs: Build-Docker-Image
name: Deploy app container to Azure
steps:
- name: "Login via Azure CLI"
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}

- uses: azure/docker-login@v1
with:
login-server: ${{env.IMAGE_REGISTRY_URL}}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Deploy web app container
uses: azure/webapps-deploy@v2
with:
app-name: ${{env.AZURE_WEBAPP_NAME}}
images: ${{env.IMAGE_REGISTRY_URL}}/${{ github.repository }}/${{env.DOCKER_IMAGE_NAME}}:${{ github.sha }}

- name: Azure logout
run: |
az logout
15 changes: 11 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"webpack-dev-server": "^3.11.0"
},
"dependencies": {
"kind-of": "^6.0.3"
"kind-of": "^6.0.3",
"node-forge": "^0.10.0"
}
}