Skip to content

Commit 905019c

Browse files
drbarzagaAlabao
andauthored
[promote-production]: May 4, 10:19PM (#34)
* [Client]: Refactoring Register UI & Adding more UI components (#17) * [client]: refactoring register ui * Add Zustand state management library * [Client]: Adding more UI components (#19) * Update README.md * fixing build issues * Update README.md * [Client]: UI Adjustments (#21) * [client]: integrating sign-in with api (#22) * Update README.md * Readme install changes and .gitignore config for IDEs. (#25) * Add .gitignore ides config folders * Add to readme yarn install version and one npm command. * [client-server]: general adjustments (#28) * Update README.md (#29) * [client]: fixing build issue (#31) * chore: Add GitHub Actions workflow for building and deploying the application (#33) --------- Co-authored-by: Rubier Sorio <[email protected]>
1 parent 2b27ee4 commit 905019c

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed

.github/workflows/pipeline.yml

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# The name of the workflow.
2+
name: Build and Deploy
3+
4+
# Run the workflow when code is pushed to the main branch
5+
on:
6+
push:
7+
branches:
8+
- main
9+
10+
# Set environment variables
11+
env:
12+
MONGODB_URL: ${{ secrets.MONGODB_URL }}
13+
14+
# This is the workflow that is being run.
15+
jobs:
16+
build-and-deploy:
17+
# This is telling GitHub to run the workflow on the latest version of Ubuntu.
18+
runs-on: ubuntu-latest
19+
steps:
20+
# Checkout the code from the GitHub repository
21+
- name: Checkout code
22+
uses: actions/checkout@v2
23+
24+
# Install dependencies and run tests for the client application
25+
- name: Install Client
26+
working-directory: ./client
27+
run: |
28+
npm install
29+
30+
# Install dependencies, export environment variables to be used by application and run tests for the server application
31+
- name: Install Server
32+
working-directory: ./server
33+
run: |
34+
npm install
35+
export MONGODB_URL=$MONGODB_URL
36+
37+
# Build a Docker image for the client application
38+
- name: Build Client Docker Image
39+
working-directory: ./client
40+
# Build image with tag drbarzaga/job-portal:client
41+
run: |
42+
docker build -t drbarzaga/job-portal:client-${{github.run_number}} .
43+
44+
# Build a Docker image for the server application
45+
- name: Build Server Docker Image
46+
working-directory:
47+
./server
48+
# Build image with tag drbarzaga/job-portal:server
49+
run: |
50+
docker build -t drbarzaga/job-portal:server-${{github.run_number}} .
51+
52+
# Login to Docker Hub using credentials from repository secrets
53+
- name: Login to Docker Hub
54+
uses: docker/login-action@v1
55+
with:
56+
username: ${{ secrets.DOCKER_USERNAME }}
57+
password: ${{ secrets.DOCKER_PASSWORD }}
58+
59+
# Push the Docker images to Docker Hub
60+
- name: Push Docker Images to Docker Hub
61+
run: |
62+
docker push drbarzaga/job-portal:client-${{github.run_number}}
63+
docker push drbarzaga/job-portal:server-${{github.run_number}}

0 commit comments

Comments
 (0)