From 30fc285d0217b1e197610de7dd7bb84ad0628dcf Mon Sep 17 00:00:00 2001 From: d-g-town <66391417+d-g-town@users.noreply.github.com> Date: Fri, 8 Nov 2024 16:27:45 -0500 Subject: [PATCH] Update porter_app_build-nov8_2.yml --- .github/workflows/porter_app_build-nov8_2.yml | 46 ++++++++++++++----- 1 file changed, 35 insertions(+), 11 deletions(-) diff --git a/.github/workflows/porter_app_build-nov8_2.yml b/.github/workflows/porter_app_build-nov8_2.yml index 32fde90..486691f 100644 --- a/.github/workflows/porter_app_build-nov8_2.yml +++ b/.github/workflows/porter_app_build-nov8_2.yml @@ -7,17 +7,41 @@ jobs: porter-deploy: runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Set Github tag - id: vars - run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT - - name: Setup porter - uses: porter-dev/setup-porter@v0.1.0 - - name: Deploy stack - timeout-minutes: 30 - run: exec porter apply - env: + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.21' + + - name: Checkout CLI repo + uses: actions/checkout@v4 + with: + repository: porter-dev/code + ref: 'dgtown/dev-cli' + token: ${{ secrets.CLI_PAT }} # Need PAT if CLI repo is private + - name: Build and install CLI + working-directory: legacy-backend + run: | + # Create dev version using PR number or timestamp + DEV_VERSION="0.0.0-dev.${GITHUB_RUN_NUMBER}" + + # Build with custom name to avoid conflicts + go build -o porter -ldflags "-X main.Version=${DEV_VERSION}" ./cli/main.go + + # Install to PATH + sudo mv porter /usr/local/bin/ + + # Verify installation + porter version + + - name: Checkout current repo + uses: actions/checkout@v4 + with: + # Clean checkout of current repo after CLI installation + clean: true + - name: Deploy stack + timeout-minutes: 30 + run: exec porter apply + env: PORTER_APP_NAME: build-nov8 PORTER_CLUSTER: "2" PORTER_DEPLOYMENT_TARGET_ID: 2ff801c5-43c8-4673-9afc-42aa5087e21c