Relayground #12
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: "Relayground" | |
on: | |
push: | |
branches: "main" | |
paths: | |
- "packages/relayground/" | |
- "/package*.json" | |
workflow_dispatch: | |
jobs: | |
build-rg-docker: | |
runs-on: ubuntu-20.04 | |
env: | |
reg: "{{ secrets.ACR_REG_PFX}}.azurecr.io" | |
appname: "relayground" | |
region: "north central us" | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup Node.js environment | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: "npm" | |
# Log into azure | |
- uses: Azure/aks-set-context@v1 | |
with: | |
creds: "${{ secrets.AZURE_CREDENTIALS }}" | |
cluster-name: ${{ secrets.AZ_CLUSTER }} | |
resource-group: ${{ secrets.AZ_RESOURCE_GROUP }} | |
# Log into docker registry for relayground | |
- uses: Azure/docker-login@v1 | |
with: | |
login-server: ${{ secrets.ACR_REG }} | |
username: ${{ secrets.REGISTRY_USERNAME }} | |
password: ${{ secrets.REGISTRY_PASSWORD }} | |
- run: | | |
TAG="${{ secrets.ACR_REG }}/${{env.appname}}:${{ github.sha }}" | |
docker build . -t ${TAG} -f containers/${{env.appname}} -o type=docker | |
docker push ${TAG} | |
- name: "Deploy to Azure Container Instances" | |
uses: "azure/aci-deploy@v1" | |
with: | |
resource-group: ${{ secrets.ACR_REG }} | |
dns-name-label: ${{ secrets.ACR_REG}}${{ github.run_number }} | |
image: ${{secrets.ACR_REG}}/${{env.appname}}:${{ github.sha }} | |
registry-login-server: ${{secrets.ACR_REG}} | |
registry-username: ${{ secrets.REGISTRY_USERNAME }} | |
registry-password: ${{ secrets.REGISTRY_PASSWORD }} | |
name: ${{env.appname}} | |
location: ${{env.region}} |