forked from swagger-api/swagger-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (65 loc) · 2.18 KB
/
release.yml
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
# This is a basic workflow to help you get started with Actions
name: Build Swagger Release
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
workflow_dispatch:
inputs:
dockerTagVersion:
description: 'Docker tag version to use'
required: true
default: 'latest'
isProduction:
description: "Is this a production release?"
type: boolean
required: true
jobs:
# Run unit-tests on all branches and releases
release:
runs-on: ubuntu-latest
steps:
- name: Create tag
uses: actions/github-script@v3
with:
script: |
github.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "refs/tags/${{ github.event.inputs.dockerTagVersion }}",
sha: context.sha
})
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- uses: actions/checkout@v2
with:
lfs: true
submodules: false
fetch-depth: 0
- name: Docker GCR Setup
if: ( github.event.inputs.isProduction != 'true' )
uses: docker/login-action@v1
with:
registry: gcr.io
username: _json_key
password: ${{ secrets.GCP_TEST_BAI_KEY_JSON }}
logout: false
- name: Docker GCR Setup (Release)
id: docker_release
if: ( github.event.inputs.isProduction == 'true' )
uses: docker/login-action@v1
with:
registry: gcr.io
username: _json_key
password: ${{ secrets.GCP_BAI_KEY_JSON_RW }}
- name: Build And Push Release
shell: bash
run: |
if [ "${{ steps.docker_release.outcome }}" == "success" ]; then
DOCKER_REGISTRY="gcr.io/gcpbai"
else
DOCKER_REGISTRY="gcr.io/test-bai"
fi
docker buildx build --push --platform linux/arm64/v8 --platform linux/amd64 -t ${DOCKER_REGISTRY}/swagger-ui:${{ github.event.inputs.dockerTagVersion }} .