Skip to content

Commit

Permalink
feat: renamed few steps
Browse files Browse the repository at this point in the history
  • Loading branch information
Filipe Forattini committed May 3, 2022
1 parent 35fef9b commit 0759dd5
Showing 1 changed file with 37 additions and 35 deletions.
72 changes: 37 additions & 35 deletions .github/workflows/service-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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 }}
Expand Down Expand Up @@ -190,28 +190,28 @@ 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
run: |
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:
Expand All @@ -225,7 +225,7 @@ jobs:
]
})
- name: Print .releaserc.json
- name: DEBUG | Print .releaserc.json
run: cat .releaserc.json

- name: Semantic Release dependencies
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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
Expand All @@ -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:
Expand All @@ -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:
Expand Down

0 comments on commit 0759dd5

Please sign in to comment.