This repository was archived by the owner on Jan 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (42 loc) · 1.36 KB
/
docker-publish.yml
File metadata and controls
52 lines (42 loc) · 1.36 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
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: owextendedruntimes/java-17
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Log into registry Docker Hub
uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
with:
username: owextendedruntimes
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 }}