Skip to content

Commit

Permalink
Use a single action file
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcusAhlfors committed Mar 17, 2024
1 parent 02a4cca commit 4131faf
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 39 deletions.
38 changes: 0 additions & 38 deletions .github/workflows/DemoSync.yaml

This file was deleted.

32 changes: 31 additions & 1 deletion .github/workflows/DiploiBuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,39 @@ env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
INITIAL_PROJECT_IMAGE_NAME: ${{ github.repository }}-initial-project

DEMO_TARGET_REPOSITORY: 'https://x-access-token:${{ secrets.DEMO_REPOSITORY_PAT }}@github.com/${{ github.repository }}-demo.git'
DEMO_TAG_NAME: '${GITHUB_REF#refs/tags/}'

jobs:

DemoSync:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Checkout source repository
uses: actions/checkout@v2

- name: Sync initialProject folder and push tag
run: |
# Configure git
git config --global user.email "[email protected]"
git config --global user.name "Demo Sync"
# Clone the target repository using HTTPS and PAT for authentication
git clone ${{ env.DEMO_TARGET_REPOSITORY }} temp_repo
cd temp_repo
# Sync the folder
rsync -av --delete --exclude='.git/' ../initialProject/ ./
# Commit and push the changes, if there are any
git add .
git diff --quiet && git diff --staged --quiet || (git commit -m "Commit sync" && git push origin main)
# Tag and push the tag
git tag ${{ env.DEMO_TAG_NAME }}
git push origin --tags
TemplateBuild:
runs-on: ubuntu-latest
permissions:
Expand Down

0 comments on commit 4131faf

Please sign in to comment.