-
Notifications
You must be signed in to change notification settings - Fork 6
37 lines (27 loc) · 1.14 KB
/
docker-ubuntu2004.clang.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
name: Docker Image [ubuntu2004.clang]
on:
push:
tags:
- ubuntu2004.clang-v*
jobs:
build:
env:
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_DOCKER_REPOSITORY: docker.pkg.github.com/${{ github.repository }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build image [ubuntu2004.clang]
run: |
docker build ./docker --file docker/Dockerfile.ubuntu2004.clang --tag ubuntu2004.clang
- name: Push image [ubuntu2004.clang]
run: |
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^ubuntu2004.clang-v//')-pre
echo ${GITHUB_TOKEN} | docker login docker.pkg.github.com -u ${GITHUB_ACTOR} --password-stdin
docker tag ubuntu2004.clang $GITHUB_DOCKER_REPOSITORY/ubuntu2004.clang:$VERSION
docker push $GITHUB_DOCKER_REPOSITORY/ubuntu2004.clang:$VERSION
docker logout