Skip to content

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

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

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

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-tags: ghcr.io/h0n9/cloud-secrets-manager:tmp
img-push: "false"
img-platforms: linux/amd64
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-tags=${{ env.img-registry }}/${{ env.img-repository }}: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-tags=${{ env.img-registry }}/${{ env.img-repository }}:${GITHUB_REF_NAME},${{ env.img-registry }}/${{ env.img-repository }}:latest" >> $GITHUB_ENV
echo "img-push=true" >> $GITHUB_ENV
echo "img-platforms=linux/amd64,linux/arm64" >> $GITHUB_ENV
- name: Build Docker image
uses: docker/build-push-action@v2
with:
platforms: ${{ env.img-platforms }}
push: ${{ env.img-push }}
tags: ${{ env.img-tags }}
cache-from: type=gha,scope=cloud-secrets-manager
cache-to: type=gha,mode=max,scope=cloud-secrets-manager