diff --git a/.github/workflows/deploy_staging.yml b/.github/workflows/deploy_staging.yml index e2cd94f..df4ab58 100644 --- a/.github/workflows/deploy_staging.yml +++ b/.github/workflows/deploy_staging.yml @@ -3,6 +3,12 @@ name: Deploy Staging on: release: types: [prereleased] + pull_request: + branches: [main] + +permissions: + id-token: write + contents: read jobs: deploy-staging: @@ -22,8 +28,10 @@ jobs: - name: Call Dagger Deploy Function uses: dagger/dagger-for-github@v5 + env: + GH_TOKEN: ${{secrets.TAP_TOKEN}} with: version: "latest" verb: call - args: deploy-helm-charts --username=${{github.actor}} --password=${{secrets.GITHUB_TOKEN}} --helm-values=ssm:tapservice-values-staging --version=24.9.0 + args: deploy-helm-charts --username=alercebroker --password=env:GH_TOKEN --helm-values=ssm:tapservice-values-staging --version=24.9.0 --dry-run=true workdir: ./ci diff --git a/tapservicego/dagger/deploy.go b/tapservicego/dagger/deploy.go index b1305c6..082dfa8 100644 --- a/tapservicego/dagger/deploy.go +++ b/tapservicego/dagger/deploy.go @@ -63,6 +63,7 @@ func (m *Tapservicego) Deploy( return dag.Container(). From("alpine/k8s:1.31.0"). With(withAWSCredentials). + WithExec([]string{"sh", "-c", fmt.Sprintf("aws eks update-kubeconfig --region us-east-1 --name %s --alias %s", "staging", "staging")}). With(m.helmValuesFile). WithWorkdir("/usr/src/app"). WithExec([]string{"helm", "registry", "login", "-u", username, "-p", pwd, "ghcr.io"}).