Skip to content
This repository has been archived by the owner on May 21, 2024. It is now read-only.

Commit

Permalink
Merge pull request #16 from LoomingEcho/feature/one-branch-only
Browse files Browse the repository at this point in the history
Feature/one branch only
  • Loading branch information
LoomingEcho authored May 17, 2024
2 parents 3f050f1 + 5fed420 commit 2975a7b
Show file tree
Hide file tree
Showing 7 changed files with 239 additions and 245 deletions.
2 changes: 2 additions & 0 deletions .github/fstab_prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
mountpoints:
/: https://drive.google.com/drive/u/0/folders/1DwCBUbNOdH6vJvbsJ1VOsEwx22492YiC
15 changes: 8 additions & 7 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ Fix #<gh-issue-id>


**Test URLs:**
- Before: https://develop--eds-dev--loomingecho.hlx.page/ <!-- On dev to main its main -->
- After: https://<branch>--eds-dev--loomingecho.hlx.page/ <!-- change <branch> to the branch name -->
- Before: https://develop--eds-dev--loomingecho.hlx.page/ <!-- On dev to main merge its main -->
- After: https://<branch>--eds-dev--loomingecho.hlx.page/ <!-- change <branch> to the branch name -->

**Checklist:**
- [ ] Tests added/passed ?
- [ ] Documentation updated ?
- [ ] PSi Checks passed ?
- [ ] Code reviewed ?
- [ ] Ready for merge ?
- [ ] Tests added/passed
- [ ] Documentation updated
- [ ] PSI Checks passed
- [ ] Test environment works as expected
- [ ] New Block/Feature/Component works on test environment
- [ ] Code reviewed
26 changes: 17 additions & 9 deletions .github/workflows/continuous-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,34 @@ jobs:
uses: actions/checkout@v4
with:
ref: main
sparse-checkout: |
dist

- name: Install dependency's
run: cd npm -ci

- name: Change fstab.yml to prod
run: |
rm fstab.yaml
cp .github/fstab_prod.yml fstab.yml
- name: Build prod dist
run: npm run build

- name: Checkout prod repository
uses: actions/checkout@v4
with:
repository: LoomingEcho/eds-prod
path: eds-prod
ref: stage
token: ${{ secrets.CD_TOKEN }}
path: prod
ref: prod

- name: Remove dist from prod
run: rm -rf eds-prod/dist
run: rm -rf prod/dist

- name: Copy dist from dev to prod stage
run: cp -r dist eds-prod/
run: cp -r dist prod/

- name: Commit and push to prod repository
run: |
cd eds-prod
cd prod
git add -f ./dist
git config --global user.name "EDS CI/CD"
git config --global user.email "[email protected]"
git add dist
Expand Down
32 changes: 7 additions & 25 deletions .github/workflows/continuous-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
with:
node-version-file: '.nvmrc'

- name: Cache/Use NPM dependencies
- name: Cache NPM dependencies
uses: actions/cache@v4
with:
path: node_modules
Expand All @@ -29,13 +29,12 @@ jobs:

lint:
runs-on: ubuntu-latest
needs:
- install-and-cache-deps
needs: install-and-cache-deps
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Cache/Use NPM dependencies
- name: Cache NPM dependencies
uses: actions/cache@v4
with:
path: node_modules
Expand All @@ -52,7 +51,7 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Cache/Use NPM dependencies
- name: Cache NPM dependencies
uses: actions/cache@v4
with:
path: node_modules
Expand All @@ -64,16 +63,12 @@ jobs:

build-and-commit-dist:
runs-on: ubuntu-latest
needs:
- lint
- test
needs: [lint, test]
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Cache/Use NPM dependencies
- name: Cache NPM dependencies
uses: actions/cache@v4
with:
path: node_modules
Expand All @@ -90,23 +85,10 @@ jobs:
- name: Add dist
run: |
pwd
git add -f ./dist
git add -f ./types
- name: Check if dist directory has changed
id: check-dist-changes
run: |
before_commit="$github.event.before"
if git diff --quiet HEAD "$before_commit" -- ./dist; then
echo "No changes detected in the dist directory."
else
echo "dist_changed=true" >> "$GITHUB_ENV"
fi
- name: Commit and push dist
if: steps.check-dist-changes.outputs.dist_changed == 'true'
run: |
git commit -m "$CI_COMMIT_MESSAGE"
git commit -m "Rebuild dist from CI"
git push
Loading

0 comments on commit 2975a7b

Please sign in to comment.