Skip to content

Docker Image CI

Docker Image CI #102

Workflow file for this run

name: Docker Image CI
on:
workflow_dispatch:
release:
types: [published, released, created, edited]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get version
id: get_version
run: echo "VERSION=$(git describe --tags $(git rev-list --tags --max-count=1))" >> $GITHUB_ENV
- name: Build the Docker image
run: |
docker version
docker login --username=${{ secrets.DOCKER_USERNAME }} --password=${{ secrets.DOCKER_PASSWORD }}
# 使用Dockerfile构建镜像
docker build -t zhenorzz/goploy:${{ env.VERSION }} . --file docker/Dockerfile
# 推送镜像到镜像仓库
docker push zhenorzz/goploy:${{ env.VERSION }}