Skip to content

feat: added environments and launch functionality to projects (#87) #63

feat: added environments and launch functionality to projects (#87)

feat: added environments and launch functionality to projects (#87) #63

name: Build
# When this action will be executed
on:
# Automatically trigger it when detected changes in repo
push:
branches:
[ main ]
paths:
- 'web/dashboard/**'
- '.github/workflows/demo-ethereal-nexus-deploy.yml'
# Allow manual trigger
workflow_dispatch:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
environment: playground
steps:
- name: Checkout to the branch
uses: actions/checkout@v2
- name: Azure Login
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: docker19diconium/remote-components
- name: 'Create env file'
run: |
echo "${{ secrets.MONGODB_URI }}" >> ./web/dashboard/.env
echo "${{ secrets.AZURE_BLOB_STORAGE_ACCOUNT }}" >> ./web/dashboard/.env
echo "${{ secrets.AZURE_BLOB_STORAGE_SECRET }}" >> ./web/dashboard/.env
echo "${{ secrets.PGHOST }}" >> ./web/dashboard/.env
echo "${{ secrets.PGUSER }}" >> ./web/dashboard/.env
echo "${{ secrets.PGPORT }}" >> ./web/dashboard/.env
echo "${{ secrets.PGPASSWORD }}" >> ./web/dashboard/.env
echo "${{ secrets.NEXT_AUTH_SECRET }}" >> ./web/dashboard/.env
echo "PGSSL=true" >> ./web/dashboard/.env
- name: Build and push container image to registry
uses: azure/container-apps-deploy-action@v2
with:
appSourcePath: ${{ github.workspace }}
dockerfilePath: web/dashboard/Dockerfile
containerAppName: demo-ethereal-nexus
resourceGroup: RG-Ethereal-Nexus
registryUrl: registry.hub.docker.com
targetPort: 3000 --registry-server registry.hub.docker.com
registryUsername: ${{ secrets.DOCKER_USERNAME }}
registryPassword: ${{ secrets.DOCKER_PASSWORD }}
imageToBuild: registry.hub.docker.com/docker19diconium/remote-components:${{ github.sha }}