diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 528c15c..c8c86ae 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -1,51 +1,23 @@ -# This workflow will build a golang project -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go - -name: Go +name: Docker Compose on: push: - branches: [ "main" ] + branches: [main] pull_request: - branches: [ "main" ] + branches: [main] jobs: - build: runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Set up Go - uses: actions/setup-go@v4 - with: - go-version: '1.20' - - - name: Build - run: go build -v ./... - - name: Test - run: go test -v ./... - - docker: - runs-on: ubuntu-latest steps: - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Build and push - uses: docker/build-push-action@v5 + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Docker Compose + uses: docker/compose-action@v1 with: - push: true - tags: user/app:latest - context: ./docker + compose-file: docker-compose.yml + + - name: Build and run containers + run: docker-compose up --build -d