upd #51
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy to Koyeb | |
on: | |
push: | |
branches: | |
- main | |
env: | |
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }} | |
DOCKER_IMAGE_NAME: duckdb-spawn | |
KOYEB_APP_NAME: duckdb-spawn | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
logout: true | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: | | |
${{ secrets.DOCKER_HUB_USERNAME }}/${{ env.DOCKER_IMAGE_NAME }}:latest | |
${{ secrets.DOCKER_HUB_USERNAME }}/${{ env.DOCKER_IMAGE_NAME }}:${{ github.sha }} | |
- name: Install Koyeb CLI | |
run: | | |
curl -fsSL https://raw.githubusercontent.com/koyeb/koyeb-cli/master/install.sh | sh | |
echo "$HOME/.koyeb/bin" >> $GITHUB_PATH | |
- name: Deploy to Koyeb | |
# Create an app on Koyeb using the koyeb.yaml file located in the root directory | |
run: | | |
koyeb service create duckdb-spawn --config ./koyeb.yaml --token ${{ secrets.KOYEB_API_TOKEN }} | |
koyeb service redeploy ${{ env.KOYEB_APP_NAME }}/api |