-
Notifications
You must be signed in to change notification settings - Fork 0
31 lines (26 loc) · 1.05 KB
/
docker-image.yml
File metadata and controls
31 lines (26 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
name: Docker Image CI
on:
push:
tags:
- '**'
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Docker Login
# You may pin to the exact commit or the version.
# uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
uses: docker/login-action@v1.9.0
with:
# Server address of Docker registry. If not set then will default to Docker Hub
registry: ${{ secrets.CONTAINER_REGISTRY_NAME }}
# Username used to log against the Docker registry
username: ${{ secrets.CONTAINER_REGISTRY_USERNAME }}
# Password or personal access token used to log against the Docker registry
password: ${{ secrets.CONTAINER_REGISTRY_PASSWORD }}
- name: Build and Push container to registry
run: |
$VERSION = "${{ github.ref }}" -replace ".+/",""
docker build . --file Dockerfile --tag ${{ secrets.CONTAINER_IMAGE_NAME }}/nanoserver-mysql:$VERSION
docker push ${{ secrets.CONTAINER_IMAGE_NAME }}/nanoserver-mysql:$VERSION