upd -- create #29
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: Setup Koyeb configuration | |
run: | | |
mkdir -p $HOME/.koyeb | |
echo "token: ${{ secrets.KOYEB_TOKEN }}" > $HOME/.koyeb/config.yaml | |
- name: Create and Deploy to Koyeb | |
env: | |
GITHUB_SHA: ${{ github.sha }} | |
run: | | |
# Create the app if it doesn't exist | |
koyeb apps create $KOYEB_APP_NAME --output json || true | |
# Deploy using the configuration file | |
koyeb apps init $KOYEB_APP_NAME -f koyeb.yaml |