-
Notifications
You must be signed in to change notification settings - Fork 74
58 lines (45 loc) · 1.81 KB
/
publish-build-env.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: publish-build-env
on:
release:
workflow_dispatch:
jobs:
golang-build-env-1-13:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build the golang-build-env Docker image
run: |
IMAGE_ID=ghcr.io/$GITHUB_REPOSITORY
IMAGE_NAME=golang-build-env-1.13
docker build --pull --no-cache . --file common/Dockerfile --tag $IMAGE_NAME
IMAGE_TAG=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
[[ "${{ github.ref }}" == "refs/tags/"* ]] && IMAGE_TAG=$(echo $IMAGE_TAG | sed -e 's/^v//')
docker tag $IMAGE_NAME $IMAGE_ID/$IMAGE_NAME:$IMAGE_TAG
docker tag $IMAGE_NAME $IMAGE_ID/$IMAGE_NAME:latest
docker push --all-tags $IMAGE_ID/$IMAGE_NAME
golang-build-env-1-16:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build the golang-build-env Docker image
run: |
IMAGE_ID=ghcr.io/$GITHUB_REPOSITORY
IMAGE_NAME=golang-build-env-1.16
docker build --pull --no-cache . --file common/Go1.16.Dockerfile --tag $IMAGE_NAME
IMAGE_TAG=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
[[ "${{ github.ref }}" == "refs/tags/"* ]] && IMAGE_TAG=$(echo $IMAGE_TAG | sed -e 's/^v//')
docker tag $IMAGE_NAME $IMAGE_ID/$IMAGE_NAME:$IMAGE_TAG
docker tag $IMAGE_NAME $IMAGE_ID/$IMAGE_NAME:latest
docker push --all-tags $IMAGE_ID/$IMAGE_NAME