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 83555fc commit d826751
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/DiploiBuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,40 @@ 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 d826751

Please sign in to comment.