Skip to content

feat: Add Go web application with Docker containerization #68

feat: Add Go web application with Docker containerization

feat: Add Go web application with Docker containerization #68

Workflow file for this run

name: Release to Docker Hub
on:
push:
branches: [ "main" ]
tags:
- "*.*.*"
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.18
- name: Checkout code
uses: actions/checkout@v3
- name: Fetch required Go modules
run: go mod download
- name: Build
run: go build -v ./...
- name: Test
run: go test -v ./...
- name: Build and push Docker image
id: docker_build
uses: docker/build-push-action@v3
with:
push: true
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/${{ github.event.repository.name }}:build-v1.001
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}