Skip to content

Commit d7ecc01

Browse files
author
Nizam Omari
committed
Starting Git Hub Actions
1 parent 021c5a6 commit d7ecc01

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

.github/workflows/backend-ci.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Backend CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
8+
jobs:
9+
build-test:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Setup PHP
17+
uses: shivammathur/setup-php@v2
18+
with:
19+
php-version: '8.4'
20+
extensions: mbstring, pdo_mysql
21+
22+
- name: Install Composer dependencies
23+
run: composer install --prefer-dist --no-progress --no-interaction
24+
25+
- name: Run tests
26+
run: php artisan test --without-tty
27+
28+
- name: Build Docker image
29+
run: docker build -t ghcr.io/${{ github.repository }}:latest .
30+
31+
- name: Login to GitHub Container Registry
32+
uses: docker/login-action@v3
33+
with:
34+
registry: ghcr.io
35+
username: ${{ github.actor }}
36+
password: ${{ secrets.GITHUB_TOKEN }}
37+
38+
- name: Push image
39+
run: docker push ghcr.io/${{ github.repository }}:latest

0 commit comments

Comments
 (0)