Skip to content

Commit

Permalink
Update go.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Aymen-Tirchi authored Sep 17, 2023
1 parent 553ed20 commit 5236dc0
Showing 1 changed file with 12 additions and 40 deletions.
52 changes: 12 additions & 40 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 5236dc0

Please sign in to comment.