Skip to content

Commit 6211d32

Browse files
author
Sean Sundberg
committed
Updates workflows
Signed-off-by: Sean Sundberg <seansund@us.ibm.com>
1 parent 32aa38e commit 6211d32

2 files changed

Lines changed: 65 additions & 1 deletion

File tree

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Docker build
2+
3+
on:
4+
release:
5+
types:
6+
- published
7+
push:
8+
branches:
9+
- master
10+
- lite
11+
12+
jobs:
13+
docker:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Set up tags
17+
id: setup
18+
run: |
19+
TAG_BASE="quay.io/ibmgaragecloud/cli-tools"
20+
21+
BRANCH=${GITHUB_REF#refs/heads/}
22+
TAG="${{ github.event.release.tag_name }}"
23+
if [[ -n "${TAG}" ]]; then
24+
echo "Running against tag: ${TAG}"
25+
TAGS="${TAG_BASE}:${TAG}"
26+
else
27+
echo "Running against branch: ${BRANCH}"
28+
TAGS="${TAG_BASE}:${BRANCH}"
29+
if [[ "${BRANCH}" == "main" ]]; then
30+
TAGS="${TAGS},${TAG_BASE}:latest"
31+
fi
32+
fi
33+
34+
echo "::set-output name=tags::${TAGS}"
35+
36+
- name: Set up QEMU
37+
uses: docker/setup-qemu-action@v1
38+
39+
- name: Set up Docker Buildx
40+
uses: docker/setup-buildx-action@v1
41+
42+
- name: Login to DockerHub
43+
uses: docker/login-action@v1
44+
with:
45+
registry: docker.io
46+
username: ${{ secrets.DOCKER_USER }}
47+
password: ${{ secrets.DOCKER_TOKEN }}
48+
49+
- name: Login to Quay
50+
uses: docker/login-action@v1
51+
with:
52+
registry: quay.io
53+
username: ${{ secrets.QUAY_USERNAME }}
54+
password: ${{ secrets.QUAY_TOKEN }}
55+
56+
- name: Build and push
57+
id: docker_build
58+
uses: docker/build-push-action@v2
59+
with:
60+
push: true
61+
tags: ${{steps.setup.outputs.tags}}
62+
63+
- name: Image digest
64+
run: echo ${{ steps.docker_build.outputs.digest }}

.github/workflows/release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
# Steps represent a sequence of tasks that will be executed as part of the job
1515
steps:
1616
# Drafts your next Release notes as Pull Requests are merged into "master"
17-
- uses: rlespinasse/github-slug-action@1.1.1
17+
- uses: rlespinasse/github-slug-action@v3.x
1818

1919
- uses: release-drafter/release-drafter@v5
2020
with:

0 commit comments

Comments
 (0)