From a30491d2ba723d1afb6ae34b9cdb01909d5898f6 Mon Sep 17 00:00:00 2001 From: Luka Savkov Date: Thu, 12 Sep 2024 18:48:21 +0200 Subject: [PATCH 1/2] Set up GitHub Actions for CI --- .github/workflows/push.yml | 50 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/push.yml diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml new file mode 100644 index 0000000..6de24e4 --- /dev/null +++ b/.github/workflows/push.yml @@ -0,0 +1,50 @@ +name: Go CI + +on: + push: + branches: + - master + +jobs: + go-ci: + runs-on: ubuntu-latest + + steps: + - name: Check out main repository + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.22.3' + + - name: Update and tidy Go modules + run: go mod tidy + + - name: Install dependencies + run: go mod download + working-directory: ./ + + - name: Build + run: go build -v ./... + working-directory: ./ + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to DockerHub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and Push Docker Image + uses: docker/build-push-action@v6 + with: + context: .. + file: ../gravity/Dockerfile + push: true + tags: ${{ secrets.DOCKERHUB_USERNAME }}/gravity:latest From 09caba3c3176b4e9b1253240b30140e893a81eb5 Mon Sep 17 00:00:00 2001 From: Luka Savkov <116888443+LukaSavkov@users.noreply.github.com> Date: Thu, 12 Sep 2024 18:53:33 +0200 Subject: [PATCH 2/2] Update push.yml --- .github/workflows/push.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 6de24e4..5957bd6 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -44,7 +44,7 @@ jobs: - name: Build and Push Docker Image uses: docker/build-push-action@v6 with: - context: .. + context: . file: ../gravity/Dockerfile push: true tags: ${{ secrets.DOCKERHUB_USERNAME }}/gravity:latest