steps.go 785 B

1234567891011121314151617181920212223242526272829
  1. package actions
  2. import (
  3. "fmt"
  4. )
  5. const updateAppActionName = "porter-dev/porter-update-action"
  6. func getCheckoutCodeStep() GithubActionYAMLStep {
  7. return GithubActionYAMLStep{
  8. Name: "Checkout code",
  9. Uses: "actions/checkout@v2.3.4",
  10. }
  11. }
  12. func getUpdateAppStep(serverURL, porterTokenSecretName string, projectID uint, clusterID uint, appName string, actionVersion string) GithubActionYAMLStep {
  13. return GithubActionYAMLStep{
  14. Name: "Update Porter App",
  15. Uses: fmt.Sprintf("%s@%s", updateAppActionName, actionVersion),
  16. With: map[string]string{
  17. "app": appName,
  18. "cluster": fmt.Sprintf("%d", clusterID),
  19. "host": serverURL,
  20. "project": fmt.Sprintf("%d", projectID),
  21. "token": fmt.Sprintf("${{ secrets.%s }}", porterTokenSecretName),
  22. },
  23. Timeout: 20,
  24. }
  25. }