-
Notifications
You must be signed in to change notification settings - Fork 1
54 lines (44 loc) · 1.34 KB
/
docker-publish.yml
File metadata and controls
54 lines (44 loc) · 1.34 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
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-19
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
env:
DOCKER_HUB_USER: mwelke
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Log into registry Docker Hub
uses: docker/login-action@v2
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@v3
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.create_tag.outputs.tag }}