diff --git a/.devcontainer/dev.docker-compose.yml b/.devcontainer/dev.docker-compose.yml index 2b97369..611f6c8 100644 --- a/.devcontainer/dev.docker-compose.yml +++ b/.devcontainer/dev.docker-compose.yml @@ -8,7 +8,7 @@ services: - .env build: context: . - dockerfile: .devcontainer/dev.Dockerfile + dockerfile: configs/docker/dev.Dockerfile args: USERNAME: devu USER_UID: 1001 @@ -17,7 +17,9 @@ services: BIN_DEPLOY_PREP: ${BIN_DEPLOY_PREP} BIN_DEPLOY_REQ: ${BIN_DEPLOY_REQ} BUN_BIN: ${BUN_BIN_R} + SSH_AUTH_SOCK: /ssh-agent volumes: + - ${SSH_AUTH_SOCK:-/dev/null}:/ssh-agent - .:/workspace - ~/.config/git/config:/etc/gitconfig networks: diff --git a/.github/workflows/new_tag.yml b/.github/workflows/new_tag.yml new file mode 100644 index 0000000..a2e9eca --- /dev/null +++ b/.github/workflows/new_tag.yml @@ -0,0 +1,48 @@ +name: Tag on version bump after rebase + +on: + push: + branches: + - main + +permissions: + contents: write + +jobs: + tag: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Get version from package.json + id: get_version + run: | + VERSION=$(grep '"version"' package.json | head -1 | sed -E 's/.*"version": *"([^"]+)".*/\1/') + echo "Detected version: $VERSION" + echo "version=$VERSION" >> $GITHUB_OUTPUT + + - name: Check if tag exists + id: tag_exists + run: | + TAG="v${{ steps.get_version.outputs.version }}" + echo "Checking for tag: $TAG" + if git rev-parse "$TAG" >/dev/null 2>&1; then + echo "Tag already exists: $TAG" + echo "exists=true" >> $GITHUB_OUTPUT + else + echo "Tag does not exist: $TAG" + echo "exists=false" >> $GITHUB_OUTPUT + fi + + - name: Create and push tag + if: steps.tag_exists.outputs.exists == 'false' + run: | + TAG="v${{ steps.get_version.outputs.version }}" + git config user.name "github-actions[bot]" + + echo "Creating tag: $TAG" + git tag "$TAG" + git push origin "$TAG" diff --git a/.devcontainer/dev.Dockerfile b/configs/docker/dev.Dockerfile similarity index 100% rename from .devcontainer/dev.Dockerfile rename to configs/docker/dev.Dockerfile