Skip to content

Commit

Permalink
feat: updated ci
Browse files Browse the repository at this point in the history
  • Loading branch information
PreciousIfeaka committed Nov 13, 2024
1 parent 08e0d58 commit cbb291b
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 68 deletions.
68 changes: 0 additions & 68 deletions .github/workflows/deployment.yml

This file was deleted.

36 changes: 36 additions & 0 deletions .github/workflows/init.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Express CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build:
runs-on: e-commerce
defaults:
run:
working-directory: /home/e-commerce-be/e-commerce

steps:
- name: Check current directory
run: pwd && ls -la

- name: Initialize Git repository if not exists
run: |
if [ ! -d .git ]; then
git init
git remote add origin https://${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git
fi
- name: Configure Git
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
- name: Fetch and reset repository
run: |
git fetch origin
git checkout main || git checkout -b main
git reset --hard origin/main

0 comments on commit cbb291b

Please sign in to comment.