Skip to content

Add Docker image

Add Docker image #6

Workflow file for this run

name: Go
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
- name: Build
run: go build -v ./...
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build image
run: |
# Login dockerhub
pwd="${{ secrets.dockerhub }}"
docker login -u="plazzari" -p="${pwd}"
# Get version
VERSION=$(awk -F '[="]' '/^const version/ {print $3}' cmd/core.go)
# Build docker images
docker build . --tag "plazzari/play:${VERSION}"
docker tag "plazzari/play:${VERSION}" plazzari/play:latest
# Deploy docker images
docker push "plazzari/play:${VERSION}"
docker push plazzari/play:latest