[Feature] Added docker workflow for image builds (#632)
* added docker workflow, images produced on tag and commit * added back optics/deployment label to helm chartbuddies-main-deployment
parent
19d4724335
commit
4ed85d69f3
@ -0,0 +1,46 @@ |
|||||||
|
name: Push to GCR GitHub Action |
||||||
|
on: |
||||||
|
push: |
||||||
|
branches: |
||||||
|
- '**' |
||||||
|
tags: |
||||||
|
- '**' |
||||||
|
# pull_request: |
||||||
|
# branches: |
||||||
|
# - 'main' |
||||||
|
jobs: |
||||||
|
build-and-push-to-gcr: |
||||||
|
runs-on: ubuntu-latest |
||||||
|
steps: |
||||||
|
- uses: actions/checkout@v2 |
||||||
|
- |
||||||
|
name: Docker meta |
||||||
|
id: meta |
||||||
|
uses: docker/metadata-action@v3 |
||||||
|
with: |
||||||
|
# list of Docker images to use as base name for tags |
||||||
|
images: | |
||||||
|
gcr.io/clabs-optics/optics-agent |
||||||
|
# generate Docker tags based on the following events/attributes |
||||||
|
tags: | |
||||||
|
type=ref,event=branch |
||||||
|
type=ref,event=pr |
||||||
|
type=sha |
||||||
|
- |
||||||
|
name: Login to GCR |
||||||
|
uses: docker/login-action@v1 |
||||||
|
with: |
||||||
|
registry: gcr.io |
||||||
|
username: _json_key |
||||||
|
password: ${{ secrets.GCLOUD_SERVICE_KEY }} |
||||||
|
- |
||||||
|
name: Build and push |
||||||
|
uses: docker/build-push-action@v2 |
||||||
|
env: |
||||||
|
DOCKER_BUILDKIT: 1 |
||||||
|
with: |
||||||
|
context: ./rust |
||||||
|
file: ./rust/Dockerfile |
||||||
|
push: true |
||||||
|
tags: ${{ steps.meta.outputs.tags }} |
||||||
|
labels: ${{ steps.meta.outputs.labels }} |
Loading…
Reference in new issue