This repository has been archived by the owner on Apr 9, 2024. It is now read-only.
chore: Release Version 1.64.0 #2503
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
name: Release | |
on: | |
push: | |
branches: | |
- "**" | |
tags: | |
- "v*" | |
pull_request: | |
jobs: | |
# taken from https://github.com/docker/build-push-action/blob/master/UPGRADE.md#tags-with-ref-and-git-labels | |
docker: | |
name: Publish Docker image | |
runs-on: ubuntu-latest | |
if: github.repository_owner == 'returntocorp' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
persist-credentials: false | |
- name: Docker meta | |
id: docker_meta | |
uses: docker/metadata-action@v3.6.1 | |
with: | |
images: returntocorp/semgrep-action,returntocorp/semgrep-agent | |
flavor: | | |
latest=auto | |
tags: | | |
type=ref,event=pr | |
type=ref,event=branch | |
type=sha,event=branch | |
type=ref,event=tag | |
type=sha,event=tag | |
type=edge | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Cache Docker layers | |
uses: actions/cache@v2.1.7 | |
with: | |
path: /tmp/.buildx-cache | |
key: ${{ runner.os }}-buildx-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-buildx- | |
- name: Build and push | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
push: true | |
tags: ${{ steps.docker_meta.outputs.tags }} | |
labels: ${{ steps.docker_meta.outputs.labels }} | |
cache-from: type=local,src=/tmp/.buildx-cache | |
cache-to: type=local,dest=/tmp/.buildx-cache,mode=max |