Browse Source

Add CI through GitHub Actions

Eric Zhang 4 years ago
parent
commit
7213e04b96
1 changed files with 35 additions and 0 deletions
  1. 35 0
      .github/workflows/ci.yml

+ 35 - 0
.github/workflows/ci.yml

@@ -0,0 +1,35 @@
+name: CI
+
+on:
+  push:
+    branches:
+      - main
+
+jobs:
+  docker:
+    name: Docker Build and Push
+    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: Install doctl
+        uses: digitalocean/action-doctl@v2
+        with:
+          token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
+
+      - name: Log in to DigitalOcean Container Registry
+        run: doctl registry login
+
+      - name: Build and push
+        id: docker_build
+        uses: docker/build-push-action@v2
+        with:
+          push: true
+          tags: registry.digitalocean.com/ekzhang/rustpad:latest
+
+      - name: Image digest
+        run: echo ${{ steps.docker_build.outputs.digest }}