Skip to content

Merge pull request #22 from h0n9/dependabot/go_modules/google.golang.… #44

Merge pull request #22 from h0n9/dependabot/go_modules/google.golang.…

Merge pull request #22 from h0n9/dependabot/go_modules/google.golang.… #44

Workflow file for this run

name: ci
on:
push:
branches:
- main
- develop
- feature/*
tags:
- v*
paths-ignore:
- ".github/**"
env:
img-registry: ghcr.io/h0n9
img-repository: cloud-secrets-manager
img-tag: latest
img-push: "false"
jobs:
build-push:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Login to GitHub Container Registry
if: ${{ github.ref_name == 'develop' || startsWith(github.ref_name, 'v') }}
uses: docker/login-action@v2
with:
registry: ${{ env.img-registry }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: "Set env vars (develop)"
if: ${{ github.ref_name == 'develop' }}
shell: bash
run: |
echo "img-tag=dev-${GITHUB_SHA::6}" >> $GITHUB_ENV
echo "img-push=true" >> $GITHUB_ENV
- name: "Set env vars (tag)"
if: ${{ startsWith(github.ref_name, 'v') }}
shell: bash
run: |
echo "img-tag=${GITHUB_REF_NAME}" >> $GITHUB_ENV
echo "img-push=true" >> $GITHUB_ENV
- name: Build Docker image
uses: docker/build-push-action@v2
with:
push: ${{ env.img-push }}
tags: ${{ env.img-registry }}/${{ env.img-repository }}:${{ env.img-tag }}
cache-from: type=gha,scope=cloud-secrets-manager
cache-to: type=gha,mode=max,scope=cloud-secrets-manager