-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Deploy | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-and-deploy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# Check out the repository | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
|
||
# Set up Docker | ||
- name: Set up Docker | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
# Log in to DigitalOcean Container Registry | ||
- name: Log in to DigitalOcean | ||
run: echo "${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}" | docker login -u "doctl" --password-stdin registry.digitalocean.com | ||
|
||
# Build and push Docker image | ||
- name: Build and push Docker image | ||
run: | | ||
docker buildx build --platform linux/amd64,linux/arm64 \ | ||
--tag registry.digitalocean.com/dailybruin/dbonline:latest \ | ||
--push . | ||
# Update Kubernetes deployment | ||
- name: Update Kubernetes deployment | ||
env: | ||
KUBECONFIG: ${{ secrets.KUBECONFIG }} | ||
run: | | ||
kubectl set image deployment/<flamingo> <container-name>=registry.digitalocean.com/dailybruin/dbonline:latest | ||
kubectl rollout status deployment/<flamingo> |