From 23f7e81147753b40dac98563975b798a9974ffd4 Mon Sep 17 00:00:00 2001 From: GozCode <40898932+cgonzalezdev@users.noreply.github.com> Date: Tue, 27 Aug 2024 16:59:55 -0500 Subject: [PATCH 1/7] Create create-deploy.yml Deployment initial --- .github/workflows/create-deploy.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/create-deploy.yml 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 From c50282c5d4820547c48ed1b9dd063f0c6a248390 Mon Sep 17 00:00:00 2001 From: GozCode <40898932+cgonzalezdev@users.noreply.github.com> Date: Tue, 27 Aug 2024 17:40:54 -0500 Subject: [PATCH 2/7] Create azure-deploy.yml --- .github/workflows/azure-deploy.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/azure-deploy.yml 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 From 724268dee4be0f9c877d51d9a9633dedc79897c6 Mon Sep 17 00:00:00 2001 From: GozCode <40898932+cgonzalezdev@users.noreply.github.com> Date: Tue, 27 Aug 2024 17:41:14 -0500 Subject: [PATCH 3/7] Update main.bicep --- config/main.bicep | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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: [ { From 234c0995a1f790ff399c98aec3791623aac228a5 Mon Sep 17 00:00:00 2001 From: GozCode <40898932+cgonzalezdev@users.noreply.github.com> Date: Tue, 27 Aug 2024 17:56:35 -0500 Subject: [PATCH 4/7] Update style.css --- src/css/style.css | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/css/style.css b/src/css/style.css index adf9cf1..18525a9 100644 --- a/src/css/style.css +++ b/src/css/style.css @@ -185,3 +185,11 @@ li { h1 { text-align: center; } + +.author { + font-size: 22px; + font-weight: bold; + background: #8e24aa; + color: #fff; + width: 270px; +} From 104e3a803696576675e9f80e1f4208157909602c Mon Sep 17 00:00:00 2001 From: GozCode <40898932+cgonzalezdev@users.noreply.github.com> Date: Tue, 27 Aug 2024 17:57:19 -0500 Subject: [PATCH 5/7] Update Hours.js --- src/components/Hours.js | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) 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 ( +
+

Horario:

+

{todayHours.day} {todayHours.open} - {todayHours.close}

+
+ ) + } + +export default Hours; From c7ed1ecdca36634e465378c8aee3b07329463073 Mon Sep 17 00:00:00 2001 From: GozCode <40898932+cgonzalezdev@users.noreply.github.com> Date: Tue, 27 Aug 2024 17:57:47 -0500 Subject: [PATCH 6/7] Update index.js --- src/pages/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pages/index.js b/src/pages/index.js index a56f1e8..e9f7653 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -3,6 +3,7 @@ import dbConnect from "../lib/dbConnect"; import Pet from "../models/Pet"; // TODO: Import Hours component +import Hours from "../components/Hours"; const Index = ({ pets }) => { @@ -10,6 +11,7 @@ const Index = ({ pets }) => { <> {/* TODO: Display Hours component */} + {/* Create a card for each pet */} {pets.map((pet) => ( @@ -70,4 +72,4 @@ export async function getServerSideProps() { return { props: { pets: pets } }; } -export default Index; \ No newline at end of file +export default Index; From ce7d944e4fbc902d25537d598dc9a417c71f41f0 Mon Sep 17 00:00:00 2001 From: GozCode <40898932+cgonzalezdev@users.noreply.github.com> Date: Tue, 27 Aug 2024 17:58:27 -0500 Subject: [PATCH 7/7] Update _app.js --- src/pages/_app.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/pages/_app.js b/src/pages/_app.js index 7dd800a..cb1bebe 100644 --- a/src/pages/_app.js +++ b/src/pages/_app.js @@ -7,16 +7,16 @@ function MyApp({ Component, pageProps }) { return ( <> - Pet Care App + Pet Care App - By Carlos Gonzalez
- Home + Inicio - Add Pet + Agregar Mascota
@@ -25,8 +25,11 @@ function MyApp({ Component, pageProps }) { src="https://upload.wikimedia.org/wikipedia/commons/1/1f/Pet_logo_with_flowers.png" alt="pet care logo" > +
+

Autor: Carlos J. Gonzalez

+
-

Adoption shelter

+

Refugio de Adopción