Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2 Set up GitHub Actions workflow #3

Merged
merged 23 commits into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/preview.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Vercel Preview Deployment
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
on:
push:
branches-ignore:
- main
jobs:
Deploy-Preview:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Vercel CLI
run: npm install --global vercel@latest
- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
- name: Build Project Artifacts
run: vercel build --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy Project Artifacts to Vercel
run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }}
21 changes: 21 additions & 0 deletions .github/workflows/production.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Vercel Production Deployment
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
on:
push:
branches:
- main
jobs:
Deploy-Production:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Vercel CLI
run: npm install --global vercel@latest
- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
- name: Build Project Artifacts
run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy Project Artifacts to Vercel
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.vercel
1 change: 1 addition & 0 deletions src/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VERCEL_URL=https://analog-fe.vercel.app
4 changes: 3 additions & 1 deletion src/components/App/App.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Welcome from '../Welcome/Welcome';
import Dashboard from '../Dashboard/Dashboard';
import { useState, useEffect } from 'react';
import { fetchData } from '../../apiCalls';

Expand All @@ -8,14 +9,15 @@ function App() {
useEffect(() => {
fetchData()
.then((data) => {
// setData(data)
setData(data)
console.log(`useEffect`, data)
})
}, [])

return (
<>
<Welcome/>
<Dashboard data={data}/>
</>
);
}
Expand Down
8 changes: 0 additions & 8 deletions src/components/App/App.test.js

This file was deleted.

2 changes: 1 addition & 1 deletion src/components/Welcome/Welcome.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function Welcome() {
return (
<>
<h1>Welcome</h1>
<div className="flex justify-center">Welcome</div>
</>
);
}
Expand Down
7 changes: 7 additions & 0 deletions src/vercel.json
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this do?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had this set up when I was messing around with GitHub Actions. It was to prevent auto deployment when it came to the main branch. We can go ahead and remove this, good catch Logan!

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"git": {
"deploymentEnabled": {
"main": false
}
}
}
5 changes: 4 additions & 1 deletion tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ["./src/**/*.{html,js}"],
content: [
"./src/components/**/*.{html,js}",
"./public/index.html",
],
theme: {
extend: {},
},
Expand Down
Loading