Workflows updated from AnchorFree/workflows:0782bf3 #15
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Workflow automatically managed by https://github.com/AnchorFree/workflows/ | |
# DO NOT EDIT HERE | |
name: Build and push Docker image | |
on: | |
push: | |
branches: | |
- '**' | |
tags: | |
- 'v*.*.*' | |
release: | |
types: | |
- released | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
docker_build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Import Secrets | |
uses: hashicorp/[email protected] | |
id: secrets | |
with: | |
url: https://vault.afdevops.com | |
method: jwt | |
role: jwt-github-role | |
path: jwt-github | |
jwtGithubAudience: https://github.com/AnchorFree | |
exportEnv: false | |
secrets: | | |
secret/devops/cloud_providers/gcp/aura-networking/gar/gh-actions-rw auth | GAR_TOKEN | |
- name: Login to registry - GAR | |
uses: docker/login-action@v2 | |
with: | |
registry: us-docker.pkg.dev | |
username: _json_key | |
password: ${{ steps.secrets.outputs.GAR_TOKEN }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Docker metadata | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: | | |
us-docker.pkg.dev/aura-networking/docker-registry/${{ github.repository }} | |
tags: | | |
type=schedule | |
type=semver,pattern=v{{version}} | |
type=semver,pattern=v{{major}}.{{minor}} | |
type=semver,pattern=v{{major}} | |
type=ref,event=branch | |
type=ref,event=tag | |
type=ref,event=pr | |
- name: Build and push | |
id: docker_build | |
uses: docker/build-push-action@v4 | |
with: | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |