Repository navigation
75 lines (63 loc) · 2.08 KB
/
Copy pathdeploy-testing.yml
File metadata and controls
75 lines (63 loc) · 2.08 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Publish Testing Image
on:
push:
branches:
- develop
paths-ignore:
- "**.md"
- "docs/**"
workflow_dispatch:
concurrency:
group: deploy-testing-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
packages: write
env:
REGISTRY: ghcr.io
jobs:
build-and-publish:
name: Build and Publish Testing
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7.0.1
- name: Normalize image name
id: image_name
run: |
set -euo pipefail
echo "value=$(echo '${{ github.repository }}' | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_OUTPUT"
- name: Set up QEMU
uses: docker/setup-qemu-action@v4
with:
platforms: arm64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Log into registry
uses: docker/login-action@v4
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# The Docker workflow publishes the same two tags with OCI labels attached.
# Whichever workflow finishes last owns the tag, so this one stamps the same
# labels; otherwise a push that lands second leaves the image without the
# revision label that deployment checks read.
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v6
with:
images: ${{ env.REGISTRY }}/${{ steps.image_name.outputs.value }}
- name: Build and push testing image
uses: docker/build-push-action@v7
with:
platforms: linux/amd64,linux/arm64
context: .
file: docker/Dockerfile
push: true
tags: |
${{ env.REGISTRY }}/${{ steps.image_name.outputs.value }}:develop
${{ env.REGISTRY }}/${{ steps.image_name.outputs.value }}:develop-omnibus
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha,scope=testing-omnibus
cache-to: type=gha,mode=max,scope=testing-omnibus