Build and Deploy #34
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: Build and Deploy | ||
on: | ||
# Push includes PR merge | ||
push: | ||
branches: | ||
- main | ||
- staging | ||
- develop | ||
- ci-gh-workflows | ||
paths: | ||
# Workflow is triggered only if src changes | ||
- backend/** | ||
- frontend/** | ||
# Allow manual trigger | ||
workflow_dispatch: | ||
jobs: | ||
backend-build: | ||
uses: hotosm/gh-workflows/.github/workflows/[email protected] | ||
with: | ||
context: . | ||
build_target: prod | ||
image_name: ghcr.io/${{ github.repository }}/backend | ||
dockerfile: Dockerfile | ||
scan_image: false | ||
secrets: inherit | ||
frontend-build: | ||
uses: naxa-developers/tasking-manager/.github/workflows/frontend-build.yml@ci-gh-workflows | ||
secrets: inherit | ||
with: | ||
node-version: 16.x | ||
context: ./frontend | ||
cache-key-file: ./frontend/yarn.lock | ||
package-manager: yarn | ||
build-dist-folder-path: ./frontend/build | ||
frontend-deploy: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- frontend-build | ||
name: Deploy Frontend Static Files | ||
steps: | ||
- name: Download build artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: ${{ needs.frontend-build.outputs.artifact-name }} | ||
- name: Debug check files | ||
run: | | ||
ls -alh | ||
ls -alh build | ||
deploy_to_vm: | ||
name: Deploy to VM | ||
needs: | ||
- frontend-build | ||
- backend-build | ||
uses: naxa-developers/tasking-manager/.github/workflows/remote_deploy_compose.yml@ci-gh-workflows | ||
Check failure on line 60 in .github/workflows/build_and_deploy.yml GitHub Actions / .github/workflows/build_and_deploy.ymlInvalid workflow file
|
||
with: | ||
docker_compose_file: docker-compose.vm.yml | ||
environment: ${{ github.ref_name }} | ||
example_env_file_path: example.env | ||
env_file_path: tasking-manager.env | ||
secrets: inherit |