Skip to content

Commit

Permalink
fix: using correct kubectl action
Browse files Browse the repository at this point in the history
  • Loading branch information
Filipe Forattini committed May 11, 2022
1 parent 0a67598 commit 25f0e87
Showing 1 changed file with 17 additions and 25 deletions.
42 changes: 17 additions & 25 deletions .github/workflows/service-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -416,20 +416,20 @@ jobs:
entrypoint: '${{ steps.node_setup.outputs.docker_entrypoint }}',
command: '${{ steps.node_setup.outputs.docker_command }}',
})
- name: Dockerfile lint
uses: hadolint/hadolint-action@v2.0.0
with:
dockerfile: Dockerfile
# build
- name: Config | Login to GHCR
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}


# build
- name: Dockerfile lint
uses: hadolint/hadolint-action@v2.0.0
with:
dockerfile: Dockerfile

- name: Build and push
uses: docker/build-push-action@v2
with:
Expand Down Expand Up @@ -547,18 +547,16 @@ jobs:
- name: K8s create secrets
if: steps.deploy_setup.outputs.deploy_as_k8s == 'true'
uses: actions-hub/kubectl@master
uses: steebchen/kubectl@v2.0.0
with:
config: ${{ secrets.KUBE_CONFIG }}
command: create secret generic --from-env-file=./manifests/k8s-secrets.env -n ${{steps.deploy_setup.outputs.deploy_namespace}} svc --dry-run=client --validate=false --output=yaml | kubectl apply -f -

- name: K8s create versioned secrets
if: steps.deploy_setup.outputs.deploy_as_k8s == 'true'
uses: actions-hub/kubectl@master
env:
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: steebchen/kubectl@v2.0.0
with:
config: ${{ secrets.KUBE_CONFIG }}
args: create secret generic --from-env-file=./manifests/k8s-secrets.env -n ${{steps.deploy_setup.outputs.deploy_namespace}} svc-${{needs.Release-Node.outputs.Version}} --dry-run=client --validate=false --output=yaml | kubectl apply -f -

- name: Config | Login to GHCR
Expand All @@ -570,11 +568,9 @@ jobs:

- name: K8s create pull secret
if: steps.deploy_setup.outputs.deploy_as_k8s == 'true'
uses: actions-hub/kubectl@master
env:
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: steebchen/kubectl@v2.0.0
with:
config: ${{ secrets.KUBE_CONFIG }}
args: create secret generic registry-token -n ${{steps.deploy_setup.outputs.deploy_namespace}} --type=kubernetes.io/dockerconfigjson --from-file=.dockerconfigjson=$HOME/.docker/config.json --dry-run=client --validate=false --output=yaml | kubectl apply -f -

- name: K8s generates YAML
Expand All @@ -597,20 +593,16 @@ jobs:
if: inputs.debug == true
run: echo -e "./k8s-to-apply.yml:\n\n$(cat ./manifests/k8s-to-apply.yml)"

- name: K8s apply YAML
- name: K8s apply yml
if: steps.deploy_setup.outputs.deploy_as_k8s == 'true'
uses: actions-hub/kubectl@master
env:
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: steebchen/kubectl@v2.0.0
with:
config: ${{ secrets.KUBE_CONFIG }}
args: apply -f ./manifests/k8s-to-apply.yml

- name: K8s get current state
if: steps.deploy_setup.outputs.deploy_as_k8s == 'true'
uses: actions-hub/kubectl@master
env:
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: steebchen/kubectl@v2.0.0
with:
config: ${{ secrets.KUBE_CONFIG }}
args: get pods -n ${{steps.deploy_setup.outputs.deploy_repository}}

0 comments on commit 25f0e87

Please sign in to comment.