add footer #140
Workflow file for this run
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
name: Github Action For Frontend | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
jobs: | |
build_and_deploy: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./ | |
strategy: | |
matrix: | |
node-version: | |
- 14.x | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'npm' | |
cache-dependency-path: ${{ github.workspace }}/package-lock.json | |
- run: npm install | |
- name: Build Docker Image | |
if: github.event_name == 'push' && github.ref == 'refs/heads/master' | |
run: | | |
run: | | |
docker build \ | |
-t remi_frontend \ | |
. | |
docker tag remi_frontend:latest nguyenvanhuan243/remi_frontend:latest | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Push Docker Image | |
if: github.event_name == 'push' && github.ref == 'refs/heads/master' | |
run: | | |
docker push nguyenvanhuan243/remi_frontend:latest | |
- name: Deploy to Render Server (Master) | |
if: github.event_name == 'push' && github.ref == 'refs/heads/master' | |
run: | | |
curl -X GET https://api.render.com/deploy/srv-co56ptkf7o1s739ab000?key=FBM5n-MMv5M | |
curl -X GET https://api.render.com/deploy/srv-co6f480l6cac73a7uii0?key=KFJgS6f3WC0 |