Skip to content

Workflow file for this run

name: Create a Docker image and deploy to Kubernetes
on:
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build Docker image
env:
VITE_CESIUM_TOKEN: ${{ secrets.VITE_CESIUM_TOKEN }}
VITE_N2YO_API_KEY: ${{ secrets.VITE_N2YO_API_KEY }}
uses: docker/build-push-action@v5
with:
push: true
tags: soylumu/orbital-satellite-tracker:${{ format('yyyyMMdd', github.event.head_commit.timestamp) }}, soylumu/orbital-satellite-tracker:latest
platforms: linux/amd64,linux/arm64,linux/arm/v7
build-args: |
VITE_CESIUM_TOKEN=${VITE_CESIUM_TOKEN}
VITE_N2YO_API_KEY=${VITE_N2YO_API_KEY}
- name: Set up kubectl
run: |
mkdir -p ~/.kube
echo "${{ secrets.KUBE_CONFIG }}" > ~/.kube/config
- name: Deploy to Kubernetes
run: |
kubectl apply -f manifests/deployment.yaml
kubectl apply -f manifests/service.yaml
kubectl apply -f manifests/ingress.yaml