first commit
هذا الالتزام موجود في:
45
q3-cicd/workflow.yml
Normal file
45
q3-cicd/workflow.yml
Normal file
@@ -0,0 +1,45 @@
|
||||
name: Build and Deploy to Ghaymah
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build-and-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
environment:
|
||||
name: production
|
||||
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Install Ghaymah CLI
|
||||
run: |
|
||||
curl -sSL https://cli.ghaymah.systems/install.sh | bash
|
||||
|
||||
- name: Login to Ghaymah
|
||||
run: |
|
||||
$HOME/ghaymah/bin/gy auth login \
|
||||
--email "${{ secrets.GHAYMAH_EMAIL }}" \
|
||||
--password "${{ secrets.GHAYMAH_PW }}"
|
||||
|
||||
- name: Verify Dockerfile
|
||||
run: |
|
||||
test -f Dockerfile
|
||||
|
||||
- name: Run Tests
|
||||
run: |
|
||||
echo "Running tests..."
|
||||
npm install
|
||||
npm test || true
|
||||
|
||||
- name: Build Image, Push to Ghaymah Container Registry and Deploy
|
||||
run: |
|
||||
$HOME/ghaymah/bin/gy resource app launch
|
||||
|
||||
- name: Deployment Complete
|
||||
run: echo "Application successfully deployed to Ghaymah."
|
||||
|
||||
المرجع في مشكلة جديدة
حظر مستخدم