buildAndRelease.yml 965 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. name: Build, Test, and Docker Push
  2. on:
  3. push:
  4. branches: [ main ]
  5. jobs:
  6. build:
  7. runs-on: ubuntu-latest
  8. steps:
  9. - name: Checkout code
  10. uses: actions/checkout@v3
  11. - name: Set up Node.js
  12. uses: actions/setup-node@v3
  13. with:
  14. node-version: '20.9.0'
  15. - name: Install dependencies
  16. run: npm install
  17. - name: Run lint checks
  18. run: npm run lint
  19. - name: Build the application
  20. run: npm run build
  21. - name: Set up Docker Buildx
  22. uses: docker/setup-buildx-action@v2
  23. - name: Log in to Docker Hub
  24. uses: docker/login-action@v2
  25. with:
  26. username: ${{ secrets.DOCKER_USERNAME }}
  27. password: ${{ secrets.DOCKER_TOKEN }}
  28. - name: Build and push multi-platform Docker images
  29. run: |
  30. docker buildx create --use
  31. docker buildx build --platform linux/amd64,linux/arm64 -t lhamacorp/oquokka-fe:latest . --push