Merge pull request #28 from AjouChatBot/feat/chatapi #23
This file contains hidden or 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: Amate FE Deployment Automizer | |
| on: | |
| push: | |
| branches: | |
| - "main" | |
| jobs: | |
| fe-build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - | |
| name: Git Checkout | |
| uses: actions/checkout@v4 | |
| - name: Create .env file | |
| run: | | |
| echo "ENV_MODE=production" >> .env | |
| echo "VITE_APP_API_URL=${{ secrets.VITE_APP_API_URL }}" >> .env | |
| echo "VITE_GOOGLE_CLIENT_ID=${{ secrets.VITE_GOOGLE_CLIENT_ID }}" >> .env | |
| - | |
| name: Vite Build | |
| run: | | |
| npm install | |
| npm run build | |
| - | |
| name: Create default.conf | |
| run: | | |
| cat <<EOF > default.conf | |
| server { | |
| listen 3000; | |
| root /app/dist; | |
| index index.html; | |
| location /health { | |
| return 200 'ok'; | |
| add_header Content-Type text/plain; | |
| } | |
| location / { | |
| try_files \$uri \$uri/ /index.html; | |
| } | |
| error_page 404 /index.html; | |
| } | |
| EOF | |
| - | |
| name: Docker Buildx | |
| uses: docker/setup-buildx-action@v1 | |
| - | |
| name: DockerHub Login | |
| uses: docker/login-action@v1 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - | |
| name: Docker Image Build & Push [FE] | |
| uses: docker/build-push-action@v2 | |
| with: | |
| context: ./ | |
| push: true | |
| tags: ajoumate/amate-fe:latest | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max |