This repository was archived by the owner on Feb 18, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (48 loc) · 1.55 KB
/
docker-publish.yml
File metadata and controls
58 lines (48 loc) · 1.55 KB
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: Build and Deploy
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
on:
push:
branches: [ main ]
paths-ignore:
- '**/*.md'
- '**/*.txt'
- '.github/workflows/codeql-analysis.yml'
env:
# github.repository as <account>/<repo>
IMAGE_NAME: mwelke/openwhisk-runtime-java-18
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
env:
DOCKER_HUB_USER: mwelke
GPR_USER: mattwelke
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Log into registry Docker Hub
uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
with:
username: ${{ env.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Create tag
if: github.event_name != 'pull_request'
id: create_tag
run: |
TAG="${{ env.IMAGE_NAME }}:$(TZ="UTC (UTC)" printf "%(%Y%m%d%H%M)T")"
echo "Tag chosen: $TAG"
echo "::set-output name=tag::$TAG"
- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.create_tag.outputs.tag }}
build-args: |
gpr_user=${{ env.GPR_USER }}
gpr_key=${{ secrets.GPR_TOKEN }}