Skip to content

Conversation

nhumrich
Copy link

@nhumrich nhumrich commented Aug 22, 2025

This implements #30079

Screenshots:
image

image

example workflow file showing two different syntaxes for environments (as supported by github):

name: Gitea Actions Demo
run-name: ${{ github.event.head_commit.message }} (${{ gitea.actor }})
on: [push]

jobs:
  prebuild:
    runs-on: ubuntu-latest
    steps:
      - run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event."
      - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!"
      - run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}."
      - name: Check out repository code
        uses: actions/checkout@v4
      - run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner."
      - run: echo "🖥️ The workflow is now ready to test your code on the runner."
      - name: List files in the repository
        run: |
          ls ${{ gitea.workspace }}
      - run: echo "🍏 This job's status is ${{ job.status }}."

  test:
    runs-on: ubuntu-latest
    steps:
      - name: do some testing
        run: |
          echo "test1"
          echo "test2"

  deploy-staging:
    runs-on: ubuntu-latest
    needs: test
    environment: staging
    steps:
      - name: deploy
        run: |
          echo "deploying image:${{ gitea.sha }}"
          sleep 4

  deploy-production:
    runs-on: ubuntu-latest
    needs: deploy-staging
    environment: 
      name: production
      url: https://production.example.org
    steps:
      - name: deploy
        run: |
          echo "deploying image:${{ gitea.sha }}"
          sleep 10

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Aug 22, 2025
@github-actions github-actions bot added modifies/translation modifies/api This PR adds API routes or modifies them modifies/go Pull requests that update Go code modifies/templates This PR modifies the template files modifies/migrations modifies/frontend labels Aug 22, 2025
@nhumrich nhumrich force-pushed the main branch 3 times, most recently from f04f0e3 to 7147169 Compare August 22, 2025 21:55

// Gitea 1.24.0 ends at database version 321
newMigration(321, "Use LONGTEXT for some columns and fix review_state.updated_files column", v1_25.UseLongTextInSomeColumnsAndFixBugs),
// Gitea 1.25.0 starts at database version 322
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Gitea 1.25.0 starts at database version 322

newMigration(321, "Use LONGTEXT for some columns and fix review_state.updated_files column", v1_25.UseLongTextInSomeColumnsAndFixBugs),
// Gitea 1.25.0 starts at database version 322
newMigration(322, "Create action_environment table for deployment environments", v1_25.CreateActionEnvironmentTable),
newMigration(323, "Create action_deployment table for deployment tracking", v1_25.CreateActionDeploymentTable),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merge the two migrations into one.

return
}

form := web.GetForm(ctx).(*forms.AddSecretForm)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
form := web.GetForm(ctx).(*forms.AddSecretForm)
form := web.GetForm(ctx).(*forms.AddEnvironmentForm)

)}}
</div>

{{if .AutoRerun}}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AutoRerun should be another feature? If that, it's better to split it into another PR.

</div>
</div>
{{end}}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move it to another sub template.

@lunny lunny added the type/feature Completely new functionality. Can only be merged if feature freeze is not active. label Aug 23, 2025
@nhumrich
Copy link
Author

Thanks for the feedback. I will address these :)

@nhumrich nhumrich force-pushed the main branch 2 times, most recently from bd88a10 to fd25c32 Compare September 1, 2025 15:30
Signed-off-by: Nick Humrich <nick.humrich@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. modifies/api This PR adds API routes or modifies them modifies/frontend modifies/go Pull requests that update Go code modifies/internal modifies/migrations modifies/templates This PR modifies the template files modifies/translation type/feature Completely new functionality. Can only be merged if feature freeze is not active.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants