45 أسطر
1009 B
YAML
45 أسطر
1009 B
YAML
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."
|
|
|