diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..58c14f3 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,10 @@ +version: 2 +updates: +- package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + labels: + - "CI/CD" + commit-message: + prefix: ci diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index ba806af..e4c7c92 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -6,33 +6,26 @@ on: - main jobs: + rename-project: if: ${{ github.repository != 'fastn-stack/fastn-template' && github.event.created }} permissions: write-all runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: ref: ${{ github.head_ref }} - - name: Set repository name and owner - run: | - echo "REPOSITORY_NAME=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV - echo "REPOSITORY_OWNER=$(echo '${{ github.repository }}' | awk -F '/' '{print $1}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV - shell: bash - name: Rename the project run: | - echo "Using '${{ env.REPOSITORY_NAME }}' and "${{ env.REPOSITORY_OWNER }}" to rename fastn package" - sed -i -e 's//${{ env.REPOSITORY_OWNER }}/g' -e 's//${{ env.REPOSITORY_NAME }}/g' FASTN.ftd - sed -i -e 's//${{ env.REPOSITORY_OWNER }}/g' -e 's//${{ env.REPOSITORY_NAME }}/g' FASTN/ds.ftd - sed -i -e 's//${{ env.REPOSITORY_OWNER }}/g' -e 's//${{ env.REPOSITORY_NAME }}/g' index.ftd - sed -i -e 's//${{ env.REPOSITORY_OWNER }}/g' -e 's//${{ env.REPOSITORY_NAME }}/g' sidebar.ftd - sed -i -e 's//${{ env.REPOSITORY_OWNER }}/g' -e 's//${{ env.REPOSITORY_NAME }}/g' README.md + # Replace placeholders in project files with actual repository owner and name + sed -i -e 's//${{ github.repository_owner }}/g' -e 's//${{ github.event.repository.name }}/g' FASTN.ftd FASTN/ds.ftd index.ftd sidebar.ftd README.md - name: Commit and push changes uses: stefanzweifel/git-auto-commit-action@v4 with: commit_message: "✅ Ready to clone and code." push_options: --force + build: needs: rename-project if: ${{ github.repository != 'fastn-stack/fastn-template' && always() && !failure() && !cancelled() }} @@ -40,11 +33,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Pull the latest commits run: git pull - - uses: FranzDiebold/github-env-vars-action@v2 - - run: sh -c "$(curl -fsSL https://fastn.com/install.sh)" + - run: source <(curl -fsSL https://fastn.com/install.sh) - name: Build the pages with fastn run: | echo "Using '$CI_REPOSITORY_NAME_SLUG/' as the base while building"