<p>I'm trying to deploy my code to GKE using github actions but getting an error during the deploy step:</p>
<p><a href="https://i.stack.imgur.com/HCcJD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HCcJD.png" alt="enter image description here" /></a></p>
<p>Here is my deployment.yaml:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-3
  namespace: default
  labels:
    type: nginx
spec:
  replicas: 1
  selector:
    matchLabels:
    - type: nginx 
  template:
    metadata:
      labels:
      - type: nginx 
    spec:
      containers:
      - image: nginx:1.14
        name: renderer
        ports:
        - containerPort: 80
</code></pre>
<p>Service.yaml:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: v1
kind: Service
metadata:
  name: nginx-3-service
spec:
  ports:
    port: 80
    protocol: TCP
    targetPort: 80
</code></pre>
<p>And my dockerfile:</p>
<pre><code>FROM ubuntu/redis:5.0-20.04_beta

# Install.
RUN apt-get update &amp;&amp;  DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata
RUN \
  sed -i 's/# \(.*multiverse$\)/\1/g' /etc/apt/sources.list &amp;&amp; \
  apt-get update &amp;&amp; \
  apt-get -y upgrade &amp;&amp; \
  apt-get install -y build-essential &amp;&amp; \
  apt-get install -y software-properties-common &amp;&amp; \
  apt-get install -y byobu curl git htop man unzip vim wget &amp;&amp; \
  rm -rf /var/lib/apt/lists/*

# Set environment variables.
ENV HOME /root

# Define working directory.
WORKDIR /root

# Define default command.
CMD [&quot;bash&quot;]
</code></pre>
<p>This is what the cloud deployments(Workloads) looks like:
<a href="https://i.stack.imgur.com/QlAQ9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QlAQ9.png" alt="enter image description here" /></a></p>
<p><a href="https://i.stack.imgur.com/aYYHJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aYYHJ.png" alt="enter image description here" /></a></p>
<p>I'm trying to push a C++ code using an ubuntu image. I just want to simply push my code to google cloud kubernetes engine.</p>
<p>Update:
I've deleted the deployment and re-run the action and got this:</p>
<p>It said that deployment is successfully created but gives off another error:</p>
<pre><code>deployment.apps/nginx-3 created
Error from server (NotFound): deployments.apps &quot;gke-deployment&quot; not found
</code></pre>

Turgut
<p>Try:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  ...
  labels:
    type: nginx  # &lt;-- correct
spec:
  ...
  selector:
    matchLabels:
      type: nginx  # incorrect, remove the '-'
  template:
    metadata:
      labels:
        type: nginx  # incorrect, remove the '-' 
    spec:
      ...
---
apiVersion: v1
kind: Service
...
spec:
  ...
  ports:
  - port: 80  # &lt;-- add '-'
    protocol: TCP
    targetPort: 80
</code></pre>
