-
Notifications
You must be signed in to change notification settings - Fork 255
65 lines (58 loc) · 2.17 KB
/
docker-build.yml
File metadata and controls
65 lines (58 loc) · 2.17 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
name: 'Docker Build'
on:
workflow_dispatch:
inputs:
buildType:
type: choice
description: 'Build Type'
required: true
options:
- Testing
- Release
buildVersion:
description: 'Build Version'
required: true
permissions:
id-token: write
contents: write
jobs:
Build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'
- name: Set AWS environment
run: |
echo "AWS_DEFAULT_REGION=us-east-1" >> $GITHUB_ENV
echo "AWS_DEFAULT_OUTPUT=json" >> $GITHUB_ENV
echo "AWS_ROLE_ARN=${{ secrets.STAGE_AWS_GITHUB_OIDC_ROLE_ARN }}" >> $GITHUB_ENV
- name: Configure AWS credentials (OIDC)
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.AWS_ROLE_ARN }}
role-session-name: GitHub_to_AWS_via_FederatedOIDC
aws-region: ${{ env.AWS_DEFAULT_REGION }}
- name: Downloading Packages
run: |
mkdir $HOME/.testsigma_os
aws s3 cp s3://hybrid-staging.testsigma.com/testsigma_os $HOME/.testsigma_os --recursive
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Building
run: |
if [[ "${{ github.event.inputs.buildType }}" == "Testing" ]]; then
bash deploy/docker/build.sh --DOCKER_VERSION=v${{ github.event.inputs.buildVersion }} --AGENT_TAG=v${{ github.event.inputs.buildVersion }} --IMAGE_NAME=server-dev
fi
if [[ "${{ github.event.inputs.buildType }}" == "Release" ]]; then
bash deploy/docker/build.sh --DOCKER_VERSION=v${{ github.event.inputs.buildVersion }} --AGENT_TAG=v${{ github.event.inputs.buildVersion }} --IMAGE_NAME=server
fi