From 0759dd575e1c903b0f599b2dd818cc4f024799a1 Mon Sep 17 00:00:00 2001 From: Filipe Forattini Date: Tue, 3 May 2022 12:31:55 -0300 Subject: [PATCH] feat: renamed few steps --- .github/workflows/service-push.yml | 72 +++++++++++++++--------------- 1 file changed, 37 insertions(+), 35 deletions(-) diff --git a/.github/workflows/service-push.yml b/.github/workflows/service-push.yml index 71c80796..cafad066 100644 --- a/.github/workflows/service-push.yml +++ b/.github/workflows/service-push.yml @@ -54,17 +54,17 @@ jobs: steps: # pre-job - - name: Cloning repository + - name: Setup | Cloning repository uses: actions/checkout@v3 - - name: Cloning tools + - name: Setup | Cloning tools uses: actions/checkout@v3 with: ref: main path: .ff repository: filipeforattini/ff-iac-github-actions - - name: Pipeline config scrapper + - name: Config | Pipeline config scrapper uses: actions/github-script@v6 id: script_setup with: @@ -77,7 +77,7 @@ jobs: }, }) - - name: Define pipeline paths + - name: Config | Define pipeline paths env: PIPELINE_SETUP: ${{ steps.script_setup.outputs.result}} id: define_builders @@ -102,17 +102,17 @@ jobs: steps: # pre-job - - name: Cloning repository + - name: Setup | Cloning repository uses: actions/checkout@v3 - - name: Cloning tools + - name: Setup | Cloning tools uses: actions/checkout@v3 with: ref: main path: .ff repository: filipeforattini/ff-iac-github-actions - - name: Load setup configs + - name: Config | Load setup configs env: PIPELINE_SETUP: ${{ needs.Setup.outputs.PipelineConfig }} id: node_setup @@ -121,7 +121,7 @@ jobs: echo "::set-output name=dependency_command::$(echo $PIPELINE_SETUP | jq -r '.code.dependencyCommand')" # install node - - name: Use Node.js ${{ matrix.node-version }} + - name: Install | Node.js ${{ matrix.node-version }} uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} @@ -190,20 +190,20 @@ jobs: steps: # pre-job - - name: Cloning repository + - name: Setup | Cloning repository uses: actions/checkout@v3 with: fetch-depth: 0 persist-credentials: false - - name: Cloning tools + - name: Setup | Cloning tools uses: actions/checkout@v3 with: ref: main path: .ff repository: filipeforattini/ff-iac-github-actions - - name: Load setup configs + - name: Config | Load setup configs env: PIPELINE_SETUP: ${{ needs.Setup.outputs.PipelineConfig }} id: node_setup @@ -211,7 +211,7 @@ jobs: echo "::set-output name=has_releaserc::$(echo $PIPELINE_SETUP | jq -r '.git.hasReleaserc')" # release - - name: Create .releaserc.json + - name: Config | Create .releaserc.json uses: actions/github-script@v6 if: steps.node_setup.outputs.has_releaserc == 'false' with: @@ -225,7 +225,7 @@ jobs: ] }) - - name: Print .releaserc.json + - name: DEBUG | Print .releaserc.json run: cat .releaserc.json - name: Semantic Release dependencies @@ -259,17 +259,17 @@ jobs: steps: # pre-job - - name: Cloning repository + - name: Setup | Cloning repository uses: actions/checkout@v3 - - name: Cloning tools + - name: Setup | Cloning tools uses: actions/checkout@v3 with: ref: main path: .ff repository: filipeforattini/ff-iac-github-actions - - name: Load setup configs + - name: Config | Load setup configs env: PIPELINE_SETUP: ${{ needs.Setup.outputs.PipelineConfig }} id: node_setup @@ -286,7 +286,7 @@ jobs: echo "::set-output name=docker_main_image::$(echo $PIPELINE_SETUP | jq -r '.dockerfile.mainImage')" # pre-build - - name: Create .dockerignore + - name: Config | Create .dockerignore uses: actions/github-script@v6 if: steps.node_setup.outputs.has_dockerignore == 'false' with: @@ -296,7 +296,7 @@ jobs: assetsToIgnore: ['node_modules'], }) - - name: Create Dockerfile + - name: Config | Create Dockerfile uses: actions/github-script@v6 if: steps.node_setup.outputs.has_dockerfile == 'false' with: @@ -317,12 +317,12 @@ jobs: dockerfile: Dockerfile # build - - name: Set up QEMU + - name: Setup | Install QEMU uses: docker/setup-qemu-action@v1 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 - - name: Login to GHCR + - name: Config | Login to GHCR uses: docker/login-action@v1 with: registry: ghcr.io @@ -339,6 +339,9 @@ jobs: tags: ${{steps.node_setup.outputs.docker_image_tags}} labels: "organization: ${{github.repository_owner}}, repository: ${{github.repository}}, branch: ${{needs.Setup.outputs.Branch}}, commit: ${{needs.Setup.outputs.ShaHash}}, date: ${{needs.Setup.outputs.Date}}, timestamp: ${{needs.Setup.outputs.Timestamp}}" + - name: Trace | List docker images + run: docker images + # - name: Run Trivy vulnerability scanner # uses: aquasecurity/trivy-action@master # env: @@ -369,17 +372,17 @@ jobs: steps: # pre-job - - name: Cloning repository + - name: Setup | Cloning repository uses: actions/checkout@v3 - - name: Cloning tools + - name: Setup | Cloning tools uses: actions/checkout@v3 with: ref: main path: .ff repository: filipeforattini/ff-iac-github-actions - - name: Load setup configs + - name: Config | Load setup configs env: PIPELINE_SETUP: ${{ needs.Setup.outputs.PipelineConfig }} id: deploy_setup @@ -393,14 +396,8 @@ jobs: echo "::set-output name=deploy_repository::$(echo $PIPELINE_SETUP | jq -r '.deploy.repository')" echo "::set-output name=deploy_tag::$(echo $PIPELINE_SETUP | jq -r '.deploy.tag')" - - name: Install YTT - uses: vmware-tanzu/carvel-setup-action@v1 - with: - only: ytt - token: ${{ secrets.GITHUB_TOKEN }} - # deploy - - name: Import GPG key + - name: Config | Import GPG key if: steps.deploy_setup.outputs.has_dev_secrets == 'true' uses: hashicorp/ghaction-import-gpg@v2.1.0 env: @@ -409,12 +406,17 @@ jobs: - name: Decrypt Dev Secrets run: | + ls -la ./manifests ls -la ./manifests/secrets - gpg --yes --batch --quiet --decrypt \ - --output ./manifests/k8s-secrets.env \ - ./manifests/secrets/dev.gpg + gpg --yes --batch --quiet --decrypt --output ./manifests/k8s-secrets.env ./manifests/secrets/dev.gpg cat ./manifests/k8s-secrets.env + - name: Install | YTT + uses: vmware-tanzu/carvel-setup-action@v1 + with: + only: ytt + token: ${{ secrets.GITHUB_TOKEN }} + - name: Create K8s secrets if: steps.deploy_setup.outputs.deploy_as_k8s == 'true' uses: actions-hub/kubectl@master @@ -439,7 +441,7 @@ jobs: > ./manifests/k8s-to-apply.yml cat ./manifests/k8s-to-apply.yml - - name: Apply Kubernetes YAML + - name: Deploy | Apply Kubernetes YAML if: steps.deploy_setup.outputs.deploy_as_k8s == 'true' uses: actions-hub/kubectl@master env: @@ -448,7 +450,7 @@ jobs: with: args: apply -f ./manifests/k8s-to-apply.yml - - name: Get current state + - name: Deploy | Get current state if: steps.deploy_setup.outputs.deploy_as_k8s == 'true' uses: actions-hub/kubectl@master env: