Use static colors on rå tekst (#217) #58
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
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy | |
# More GitHub Actions for Azure: https://github.com/Azure/actions | |
# Primary ref: https://dev.to/ckgrafico/deploying-nextjs-to-azure-web-app-with-github-actions-1o9c | |
name: (DEV) Deploy | |
on: | |
push: | |
paths: | |
- frontend/** | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
build-and-deploy-backend: | |
name: 'Build and deploy Backend' | |
runs-on: ubuntu-latest | |
environment: Development | |
steps: | |
# Checkout the repo | |
- uses: actions/checkout@main | |
# Setup .NET Core SDK | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: '7.x.x' | |
# Run dotnet build and publish | |
- name: Build | |
working-directory: backend/Api/ | |
run: | | |
dotnet restore | |
dotnet build --configuration Release | |
dotnet publish -c Release --property:PublishDir='./build' | |
# Deploy to Azure Web apps | |
- name: Deploy to App Service | |
uses: azure/webapps-deploy@v2 | |
with: | |
app-name: vibes-backend-dev | |
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE_BACKEND }} # Define secret variable in repository settings as per action documentation | |
package: 'backend/Api/build' | |
build-frontend: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0 | |
- name: Log in to GitHub container registry | |
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ github.token }} | |
- name: Lowercase the repo name and username | |
run: echo "REPO=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV} | |
- name: Build and push container image to registry | |
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0 | |
with: | |
push: true | |
tags: ghcr.io/${{ env.REPO }}-frontend:${{ github.sha }} | |
file: Frontend.Dockerfile | |
deploy-frontend: | |
permissions: | |
contents: none | |
runs-on: ubuntu-latest | |
needs: build-frontend | |
environment: | |
name: 'Development' | |
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} | |
steps: | |
- name: Lowercase the repo name and username | |
run: echo "REPO=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV} | |
- name: Deploy to Azure Web App | |
id: deploy-to-webapp | |
uses: azure/webapps-deploy@v2 | |
with: | |
app-name: vibes-frontend-dev | |
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE_FRONTEND }} | |
images: 'ghcr.io/${{ env.REPO }}-frontend:${{ github.sha }}' |