-
Notifications
You must be signed in to change notification settings - Fork 1
30 lines (27 loc) · 1.05 KB
/
release.yml
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
name: Release
on:
push:
tags:
- v*.*.*
branches-ignore:
- '**'
env:
IMAGE_NAME: diesel
jobs:
image:
name: Build Docker Image
runs-on: ubuntu-latest
steps:
- name: Set IMAGE_TAG env
run: echo "IMAGE_TAG=$(echo ${GITHUB_REF:11})" >> $GITHUB_ENV
- uses: actions/checkout@v2
- name: Login GitHub Registry
run: docker login docker.pkg.github.com -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }}
- name: Build Image
run: docker build -t docker.pkg.github.com/mazrean/docker-diesel/${IMAGE_NAME}:${IMAGE_TAG}-mysql .
- name: Push image to GitHub Registry
run: docker push docker.pkg.github.com/mazrean/docker-diesel/${IMAGE_NAME}:${IMAGE_TAG}-mysql
- name: Push image to GitHub Registry (latest)
run: |
docker tag docker.pkg.github.com/mazrean/docker-diesel/${IMAGE_NAME}:$IMAGE_TAG-mysql docker.pkg.github.com/mazrean/docker-diesel/${IMAGE_NAME}:latest-mysql
docker push docker.pkg.github.com/mazrean/docker-diesel/${IMAGE_NAME}:latest-mysql