-
Notifications
You must be signed in to change notification settings - Fork 1
74 lines (64 loc) · 2.09 KB
/
deploy.yml
File metadata and controls
74 lines (64 loc) · 2.09 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
name: 🚀 Deploy
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches:
- master
env:
CONTAINER_NAME: ubiqube/cld-blueprint-installer
jobs:
build-and-publish:
name: Build and Publish Docker Image
runs-on: ubuntu-latest #self-hosted
permissions:
id-token: write
packages: write
contents: read
attestations: write
steps:
- name: Checkout latest code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: "${{ env.CONTAINER_NAME }}"
tags: |
type=sha,format=long
latest
- name: Build Docker image and publish to Docker Hub
id: push
uses: docker/build-push-action@v6
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
provenance: mode=max
sbom: true
tags: "${{ steps.meta.outputs.tags }}"
labels: ${{ steps.meta.outputs.labels }}
- name: Notify msa-docker repo about updated ${{ env.CONTAINER_NAME }} Docker image
uses: benc-uk/workflow-dispatch@v1
if: github.event_name != 'pull_request'
with:
token: ${{ secrets.MSA_DOCKER_REPO_ACCESS_TOKEN }}
ref: ${{ github.ref_name || 'master' }}
repo: ubiqube/msa-docker
workflow: create-pr.yml
inputs: |-
{
"image_name": "${{ env.CONTAINER_NAME }}",
"image_tag": "sha-${{ github.sha }}",
"latest_commit_message": "${{ env.LATEST_COMMIT_MESSAGE }}",
"team_reviewers": "${{ env.REVIEWERS }}",
"branch_name": "${{ github.ref_name }}"
}