2024-10-22 08:39 - #9
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: Frontend CI/CD | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'frontend/**' # Solo ejecuta si se modifica algo dentro de frontend/ | |
pull_request: | |
branches: | |
- main | |
paths: | |
- 'frontend/**' # Solo ejecuta si el PR afecta archivos dentro de frontend/ | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Build Docker image | |
run: docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/plotter-frontend:latest ./frontend | |
- name: Login to DockerHub | |
run: echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login -u "${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin | |
- name: Push Docker image to DockerHub | |
run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/plotter-frontend:latest |