From 20a2dcacffb043cd637e256525462692e70a567a Mon Sep 17 00:00:00 2001 From: Dmitriy Lyalyuev Date: Fri, 14 Oct 2022 11:41:01 +0300 Subject: [PATCH] feat: add github actions builds --- .github/workflows/build.yaml | 63 ++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index e69de29..69b5515 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -0,0 +1,63 @@ +name: build + +on: + push: + branches: + - 'master' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + 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 DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Extract metadata for the Docker image + id: meta + uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 + with: + images: dntsk/later42 + + - name: Build and push + uses: docker/build-push-action@v3 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + + deploy: + runs-on: ubuntu-latest + needs: [build] + steps: + - name: Deploy + run: |- + mkdir -p /home/runner/.ssh + echo "$SSH_KEY" > /home/runner/.ssh/id_rsa + chmod 600 /home/runner/.ssh/id_rsa + cat >> /home/runner/.ssh/config <