diff --git a/.github/workflows/azure-deploy.yml b/.github/workflows/azure-deploy.yml new file mode 100644 index 0000000..b43f661 --- /dev/null +++ b/.github/workflows/azure-deploy.yml @@ -0,0 +1,25 @@ + name: Deploy to Azure + on: + push: + branches: + - main + + jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Log in to Azure + uses: azure/login@v1 + with: + creds: ${{ secrets.AZURE_CREDENTIALS }} + + - name: Build and deploy Container App + uses: azure/container-apps-deploy-action@v1 + with: + appSourcePath: ${{ github.workspace }} + acrName: ${{ vars.AZURE_PREFIX }}acr + resourceGroup: ${{ vars.AZURE_RG }} + containerAppName: ${{ vars.AZURE_PREFIX }}containerapp diff --git a/.github/workflows/create-deploy.yml b/.github/workflows/create-deploy.yml new file mode 100644 index 0000000..8e2e026 --- /dev/null +++ b/.github/workflows/create-deploy.yml @@ -0,0 +1,24 @@ +name: Create Azure resources +on: [workflow_dispatch] +jobs: + build-and-deploy: + runs-on: ubuntu-latest + steps: + + # Checkout codes + - uses: actions/checkout@main + + # Log into Azure + - uses: azure/login@v1 + with: + creds: ${{ secrets.AZURE_CREDENTIALS }} + + # Deploy Bicep file + - name: create resources + uses: azure/arm-deploy@v1 + with: + subscriptionId: ${{ secrets.AZURE_SUBSCRIPTION }} + resourceGroupName: ${{ vars.AZURE_RG }} + template: ${{ github.workspace }}/config/main.bicep + parameters: 'namePrefix=${{ vars.AZURE_PREFIX }}' + failOnStdErr: false diff --git a/config/main.bicep b/config/main.bicep index 42e6d0a..c460d0c 100644 --- a/config/main.bicep +++ b/config/main.bicep @@ -108,7 +108,7 @@ resource containerApp 'Microsoft.App/containerApps@2022-03-01' = { configuration: { ingress: { external: true - targetPort: 80 + targetPort: 3000 allowInsecure: false traffic: [ { diff --git a/src/components/Hours.js b/src/components/Hours.js index d51ab5c..0ecdba9 100644 --- a/src/components/Hours.js +++ b/src/components/Hours.js @@ -1 +1,32 @@ -// Placeholder to host a component +import React from "react"; + + const Hours = () => { + // add logic + + const shelterHours = [ + { day: "Monday", open: "10:00", close: "16:00" }, + { day: "Tuesday", open: "10:00", close: "16:00" }, + { day: "Wednesday", open: "10:00", close: "16:00" }, + { day: "Thursday", open: "10:00", close: "16:00" }, + { day: "Friday", open: "10:00", close: "16:00" }, + { day: "Saturday", open: "9:00", close: "20:00" }, + { day: "Sunday", open: "9:00", close: "20:00" }, + + ] + + // get the long day name and store it in a variable called today + const today = new Date().toLocaleDateString('en-US', { weekday: 'long' }); + + // get today's hours + const todayHours = shelterHours.find((day) => day.day === today); + + // display today and the hours in an div with an id of hours + return ( +
{todayHours.day} {todayHours.open} - {todayHours.close}
+Autor: Carlos J. Gonzalez
+