Skip to content

Change title

Change title #24

Workflow file for this run

name: Frontend CI/CD Pipeline
on:
push:
pull_request:
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout project sources
uses: actions/checkout@v4
- name: Print Folder Structure
run: |
echo "Printing the folder structure:"
ls -la
- name: Replace apiGatewayBaseUrl in environment.prod.ts
run: |
sed -i "s|apiGatewayBaseUrl:.*|apiGatewayBaseUrl: \\\"http://${{ secrets.DROPLET_IP_ADDRESS }}\\\",|" \
FE_Fitness_Tracker/src/environments/environment.prod.ts
- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install Dependencies
run: npm install
working-directory: FE_Fitness_Tracker
- name: Build
run: npm run build:prod
working-directory: FE_Fitness_Tracker
- name: Print Folder Structure
run: |
echo "Printing the folder structure:"
ls -la
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: dist_folder
path: FE_Fitness_Tracker/dist/
build-and-push-docker:
needs: build-and-test
uses: ASE-WS23-GruppeA/workout-tracker/.github/workflows/docker-build-and-push.yml@main
with:
docker_image_tag: 'registry.digitalocean.com/do-ase-registry/frontend'
build_artifact_name: 'dist_folder'
build_artifact_path: 'FE_Fitness_Tracker/dist'
docker_build_dockerfile_path: 'FE_Fitness_Tracker/Dockerfile'
docker_build_context_path: 'FE_Fitness_Tracker'
secrets:
DIGITALOCEAN_ACCESS_TOKEN: "${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}"
restart-application:
needs: build-and-push-docker
uses: ASE-WS23-GruppeA/workout-tracker/.github/workflows/docker-compose-restart.yml@main
secrets:
DROPLET_IP_ADDRESS: "${{ secrets.DROPLET_IP_ADDRESS }}"
DROPLET_SSH_KEY: "${{ secrets.DROPLET_SSH_KEY }}"