-
Notifications
You must be signed in to change notification settings - Fork 7
55 lines (48 loc) · 1.78 KB
/
test.yaml
File metadata and controls
55 lines (48 loc) · 1.78 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
name: Docker Main
permissions:
contents: read
on:
pull_request:
jobs:
publish:
runs-on: ubuntu-22.04
outputs:
sha-tag: ${{ steps.metadata.outputs.sha-tag }}
image: ${{ steps.metadata.outputs.image }}
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Set up QEMU
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2
- name: Login to DockerHub
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Prepare Image Metadata
id: metadata
run: |
IMAGE=pomerium/mcp-app-demo
SHA_TAG=git-${GITHUB_SHA::8}
TAGS=${IMAGE}:main
TAGS=${TAGS},${IMAGE}:${SHA_TAG}
TS=$(date +%Y%m%d%H%M%S)
echo "tags=${TAGS}" >> $GITHUB_OUTPUT
echo "timestamp=${TS}" >> $GITHUB_OUTPUT
echo "name=${IMAGE}" >> $GITHUB_OUTPUT
echo "image=${IMAGE}" >> $GITHUB_OUTPUT
echo "sha-tag=${SHA_TAG}" >> $GITHUB_OUTPUT
- name: Docker Publish - Main
uses: docker/build-push-action@14487ce63c7a62a4a324b0bfb37086795e31c6c1
with:
context: .
file: ./Dockerfile
push: false
platforms: linux/amd64
tags: ${{ steps.metadata.outputs.tags }}
labels: |
org.opencontainers.image.created=${{ steps.metadata.outputs.timestamp }}
org.opencontainers.image.name=${{ steps.metadata.outputs.name }}
org.opencontainers.image.revision=${{ github.sha }}