-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (38 loc) · 1.18 KB
/
build-publish.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
31
32
33
34
35
36
37
38
39
40
41
name: build-publish
env:
DOCKER_IMAGE_NAME: paniclobster/devcontainer-base
on:
push:
tags:
- v*.*.*
jobs:
build-publish:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- variant: alpine
tagLatest: alpine
tagSuffix: alpine
- variant: debian
tagLatest: latest
tagSuffix: ""
steps:
- name: Checkout source code
uses: actions/checkout@v2.3.4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
- name: Get release version
id: get_release_version
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/v}
- name: Build and Push the Docker image
uses: docker/build-push-action@v2.2.0
with:
context: ${{ matrix.variant }}
push: true
tags: ${{ env.DOCKER_IMAGE_NAME }}:${{ steps.get_release_version.outputs.tag }}${{ matrix.tagSuffix }},${{ env.DOCKER_IMAGE_NAME }}:${{ matrix.tagLatest }}