-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathstg-from-version-build-push-tag-base-image-arm64.yaml
More file actions
101 lines (90 loc) · 3.6 KB
/
Copy pathstg-from-version-build-push-tag-base-image-arm64.yaml
File metadata and controls
101 lines (90 loc) · 3.6 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: (ARM64) Staging Build and Push From Repo Integration Version
on:
workflow_dispatch:
inputs:
Tag:
description: "Tag: Repo Integration Version to pull, build, and push to ECR and S3."
default: "1.1.1"
type: string
required: true
CopyVersionScript:
description: "CopyVersionScript: (default true) If True generate_versions.sh will be copied from the release and added to the docker image"
default: true
type: boolean
VersionSuffix:
description: "Optional suffix appended to the version tag (e.g. 'c1' produces image tag '26.3.1-c1'). ZIP is still downloaded using the base Tag."
default: ""
type: string
required: false
TriggeredBy:
description: "TriggeredBy: (default manual) Indicates what triggered this workflow. Set to 'ubuntu-refresh' to suppress Slack notifications."
default: "manual"
type: string
permissions:
contents: write
id-token: write
jobs:
Staging_Build_And_Push_Base_Image_From_Version_ARM64:
runs-on: [mend-self-hosted, profile=repo-integration-arm-od]
steps:
- name: Check out code
uses: actions/checkout@v3
with:
ref: "main"
fetch-depth: 0
- name: Compute full version tag
run: |
SUFFIX="${{ github.event.inputs.VersionSuffix }}"
if [ -n "$SUFFIX" ]; then
FULL_TAG="${{ github.event.inputs.Tag }}-$SUFFIX"
else
FULL_TAG="${{ github.event.inputs.Tag }}"
fi
echo "FULL_TAG=$FULL_TAG" >> $GITHUB_ENV
echo "Full version tag: $FULL_TAG"
shell: bash
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: "arn:aws:iam::472613559203:role/github-actions-repo-integration-docker-base-images-role"
aws-region: us-east-1
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
with:
registries: "054331651301"
region: "us-east-1"
mask-password: true
- name: Download GHE ZIP from S3
run: |
echo "🔽 Starting download process..."
./bin/download.sh "${{ github.event.inputs.Tag }}"
echo "✅ Download completed successfully"
shell: bash
- name: Extract and Generate Base Image Dockerfiles
run: |
echo "🔧 Starting Dockerfile generation process..."
./bin/copy.sh "${{ github.event.inputs.Tag }}" "${{ github.event.inputs.CopyVersionScript }}"
echo "✅ Dockerfile generation completed successfully"
shell: bash
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build Docker Images (ARM64)
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
run: |
echo "🔨 Starting ARM64 Docker build process..."
./bin/build.sh "${{ env.FULL_TAG }}" "$ECR_REGISTRY" "${{ github.event.inputs.CopyVersionScript }}" "-arm64" "${{ github.event.inputs.Tag }}"
echo "✅ ARM64 Docker build completed successfully"
shell: bash
- name: Publish to ECR (ARM64)
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
run: |
echo "📤 Starting ARM64 ECR publish process..."
./bin/publish.sh "${{ env.FULL_TAG }}" "$ECR_REGISTRY" "-arm64"
echo "✅ ARM64 ECR publish completed successfully"
shell: bash