如何从Github Actions部署到Digital Ocean Kubernetes?



Github repo: https://github.com/jonesrussell/portfolio-sapper

这是我的Github Action YML:

name: Build and Deploy
on:
push:
branches:
- main
jobs:
export-docker:
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
tags: jonesrussell/portfolio-app:latest
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
- name: DigitalOcean Kubernetes
uses: matootie/dokube@v1.3.4
with:
personalAccessToken: ${{ secrets.DIGITALOCEAN_TOKEN }}
clusterName: galaxy-k8s

我不知道如何:kubectl应用-f kubernetes。Yml with matootie/dokube@v1.3.4

欢呼

matootie/dokube所做的是配置kubectl并将其添加到运行器路径。在你的工作流中使用它之后,你可以使用kubectl可执行文件添加任何额外的步骤,就像你会做任何其他事情一样,就像我添加到你的原始工作流文件一样:

name: Build and Deploy
on:
push:
branches:
- main
jobs:
export-docker:
runs-on: ubuntu-latest
steps:
...
- name: Apply changes
run: kubectl apply -f kubernetes.yml

免责声明:我是这个仓库的作者。

相关内容

  • 没有找到相关文章

最新更新