Skip to content

Commit

Permalink
fix: reorganized steps order by function
Browse files Browse the repository at this point in the history
  • Loading branch information
Filipe Forattini committed May 9, 2022
1 parent ff93b26 commit 79bb40d
Showing 1 changed file with 31 additions and 30 deletions.
61 changes: 31 additions & 30 deletions .github/workflows/service-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,11 @@ jobs:
path: .ff
repository: filipeforattini/ff-iac-github-actions

- name: Install | Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Config | Load setup configs
env:
PIPELINE_SETUP: ${{ needs.Setup.outputs.PipelineConfig }}
Expand All @@ -192,12 +197,6 @@ jobs:
echo "::set-output name=cache_key::$(echo $PIPELINE_SETUP | jq -r '.code.cacheKey')"
echo "::set-output name=dependency_command::$(echo $PIPELINE_SETUP | jq -r '.code.dependencyCommand')"
# install node
- name: Install | Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

# load caches
- name: Load cache from yarn.lock
uses: actions/cache@v2
Expand Down Expand Up @@ -225,8 +224,11 @@ jobs:
run: ${{ steps.node_setup.outputs.dependency_command }}

# run scripts
- run: npm run lint --if-present
- run: npm run test --if-present
- name: Run linter
run: npm run lint --if-present

- name: Run tests
run: npm run test --if-present


#--------------------------------------------------#
Expand Down Expand Up @@ -283,8 +285,7 @@ jobs:
env:
PIPELINE_SETUP: ${{ needs.Setup.outputs.PipelineConfig }}
id: node_setup
run: |
echo "::set-output name=has_releaserc::$(echo $PIPELINE_SETUP | jq -r '.git.hasReleaserc')"
run: echo "::set-output name=has_releaserc::$(echo $PIPELINE_SETUP | jq -r '.git.hasReleaserc')"

# release
- name: Config | Create .releaserc.json
Expand Down Expand Up @@ -350,6 +351,12 @@ jobs:
path: .ff
repository: filipeforattini/ff-iac-github-actions

- name: Install | QEMU
uses: docker/setup-qemu-action@v1

- name: Install | Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Config | Load setup configs
env:
PIPELINE_SETUP: ${{ needs.Setup.outputs.PipelineConfig }}
Expand Down Expand Up @@ -400,12 +407,6 @@ jobs:
dockerfile: Dockerfile

# build
- name: Install | QEMU
uses: docker/setup-qemu-action@v1

- name: Install | Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Config | Login to GHCR
uses: docker/login-action@v1
with:
Expand Down Expand Up @@ -474,6 +475,18 @@ jobs:
path: .ff
repository: filipeforattini/ff-iac-github-actions

- name: Install | YTT
uses: vmware-tanzu/carvel-setup-action@v1
with:
only: ytt
token: ${{ secrets.GITHUB_TOKEN }}

- name: Install | QEMU
uses: docker/setup-qemu-action@v1

- name: Install | Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Config | Load setup configs
env:
PIPELINE_SETUP: ${{ needs.Setup.outputs.PipelineConfig }}
Expand Down Expand Up @@ -508,7 +521,7 @@ jobs:
with:
args: delete secret svc -n ${{steps.deploy_setup.outputs.deploy_repository}} --ignore-not-found

- name: K8s delete secrets versioned
- name: K8s delete versioned secrets
if: steps.deploy_setup.outputs.deploy_as_k8s == 'true'
uses: actions-hub/kubectl@master
env:
Expand All @@ -526,7 +539,7 @@ jobs:
with:
args: create secret generic --from-env-file=./manifests/k8s-secrets.env -n ${{steps.deploy_setup.outputs.deploy_repository}} svc

- name: K8s create secrets versioned
- name: K8s create versioned secrets
if: steps.deploy_setup.outputs.deploy_as_k8s == 'true'
uses: actions-hub/kubectl@master
env:
Expand All @@ -535,12 +548,6 @@ jobs:
with:
args: create secret generic --from-env-file=./manifests/k8s-secrets.env -n ${{steps.deploy_setup.outputs.deploy_repository}} svc-${{needs.Release-Node.outputs.Version}}

- name: Install | QEMU
uses: docker/setup-qemu-action@v1

- name: Install | Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Config | Login to GHCR
uses: docker/login-action@v1
with:
Expand Down Expand Up @@ -570,12 +577,6 @@ jobs:
with:
args: create secret generic registry-token -n ${{steps.deploy_setup.outputs.deploy_repository}} --type=kubernetes.io/dockerconfigjson --from-file=.dockerconfigjson=$HOME/.docker/config.json

- name: Install | YTT
uses: vmware-tanzu/carvel-setup-action@v1
with:
only: ytt
token: ${{ secrets.GITHUB_TOKEN }}

- name: K8s generates YAML
if: steps.deploy_setup.outputs.deploy_as_k8s == 'true'
run: |
Expand Down

0 comments on commit 79bb40d

Please sign in to comment.