Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to deploy with v0.8.0 using either workflow dispatch nor a merged PR trigger #94

Open
alexxsxnchez opened this issue Nov 19, 2024 · 1 comment · May be fixed by #97
Open

Not able to deploy with v0.8.0 using either workflow dispatch nor a merged PR trigger #94

alexxsxnchez opened this issue Nov 19, 2024 · 1 comment · May be fixed by #97

Comments

@alexxsxnchez
Copy link

Using v0.8.0, we're seeing an issue where nothing actually gets deployed even though the GH action succeeds. From what I can tell, it looks like the SKIP_IMAGE_OR_DAGS_DEPLOY value is never set to false, so the deploy step is skipped. In the logs I see an empty files changed: line, even though there should be changes (sometimes normal DAG changes within the dags/ folder and other times non-dag changes).

We are triggering this action from a workflow dispatch call, usually just against the master branch.
However, we have also triggered the action from a merged PR and I’m seeing the same issue.
On the other hand, if the action is triggered from a pushed branch, then the deploy is successful (both DAG-only deploys, and full-image deploys).

The only parameters we're passing are the deployment-id and a description.

@sakethsomaraju
Copy link

Steps to reproduce:

  1. Create a new deployment in astro. Create API_TOKEN with deployment admin for the same deployment.
  2. create github secrets with deployment ID and deployment token with keys ASTRO_DEPLOYMENT_ID andASTRO_API_TOKEN respectively.
  3. create a new GitHub repository and clone it.
  4. Add the following workflow in .github/workflows/deploy.yml
name: "[Manual Trigger] - Deploy to Production"

run-name: Deploy '${{ github.ref_name }}' to Prod

on:
  workflow_dispatch:

env:
  ASTRONOMER_SKIP_PARSE: true

concurrency:
  group: ${{ github.workflow }}  # group at the workflow level

jobs:
  verify_valid_ref:
    runs-on: ubuntu-latest
    steps:
      - name: Check that REF is either the master branch or a version tag
        run: |
          REF=${{ github.ref }}
          echo "Selected REF: $REF"

          if [[ "$REF" == "refs/heads/main" || "$REF" =~ ^refs/tags/v[0-9]+$ ]]; then
            echo "Selected REF is valid: $REF"
          else
            echo "Invalid REF: $REF"
            exit 1
          fi

  deploy:
    needs: verify_valid_ref
    if: success()
    environment: production
    runs-on: ubuntu-latest
    env:
      ASTRO_API_TOKEN: ${{ secrets.ASTRO_API_TOKEN }}
        
    steps:
      - name: Set Deployment Version
        run: |
          REF_NAME=${{ github.ref_name }}
          if [[ "$REF_NAME" == "master" ]]; then
            echo "VERSION=master (latest version)" >> $GITHUB_ENV
          else
            echo "VERSION=$REF_NAME" >> $GITHUB_ENV
          fi
      - name: Deploy to Astro
        uses: astronomer/[email protected]
        with:
          deployment-id: ${{ secrets.ASTRO_DEPLOYMENT_ID }}
          description: "@${{ github.actor }} deployed ${{ env.VERSION }}"
      
  1. Perform astro dev init in the same repository.
  2. Commit and push to the remote repository.
  3. Trigger the workflow.
    Image
    The workflow succeeds, but the deployment is not updated. The workflow log shows files changed: as blank, although files are updated.

Expected behaviour

Workflow succeed with deployment update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants