-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yaml
63 lines (59 loc) · 2.09 KB
/
action.yaml
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
name: Container Build Push
description: Action to build a container and push it to the container repo
inputs:
version:
description: The version of the container
required: true
push:
description: Push the container to the container repo
required: false
default: "true"
acr-client-id:
description: Azure Container Registry client id
required: true
acr-password:
description: Azure Container Registry client secret
required: true
auth-token:
description: Dependency auth token
required: false
working-dir:
description: The working directory of the project
required: false
default: "."
runs:
using: composite
steps:
- name: Generate DateTime
run: |
echo "NOW=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV
shell: bash
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to Azure Container Repository
uses: docker/login-action@v1
with:
registry: beezlabs.azurecr.io
username: ${{ inputs.acr-client-id }}
password: ${{ inputs.acr-password }}
- name: Checkout
uses: actions/checkout@v2
- name: Build and push Docker images
uses: docker/build-push-action@v2
with:
pull: true
push: ${{ inputs.push }}
tags: beezlabs.azurecr.io/containers/beezlabs/${{ github.event.repository.name }}:${{ inputs.version }}
context: ${{ inputs.working-dir }}
labels: |
org.opencontainers.image.created=${{ env.NOW }}
org.opencontainers.image.version=${{ inputs.version }}
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.vendor=Beez Innovation Labs Pvt Ltd
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
secrets: |
"NPM_TOKEN=//npm.pkg.github.com/:_authToken=${{ inputs.auth-token }}
@beezlabs-org:registry=https://npm.pkg.github.com/"
"GO_PRIVATE_SECRET=${{ inputs.auth-token }}"
"GPR_USERNAME=beezlabs"
"GPR_PASSWORD=${{ inputs.auth-token }}"