Skip to content

Merge pull request #116 from AndrejaKovacic/misc-fix_guardrails_link #53

Merge pull request #116 from AndrejaKovacic/misc-fix_guardrails_link

Merge pull request #116 from AndrejaKovacic/misc-fix_guardrails_link #53

Workflow file for this run

on:
push:
branches:
- main
tags:
- '*'
permissions:
packages: write
env:
REGISTRY: ghcr.io
IMAGE_NAME: "${{ github.repository_owner }}/autopr"
jobs:
build_latest:
if: github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and cache Docker image (in-development)
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest"
cache-from: type=gha
cache-to: type=gha,mode=max
build_tag:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}"
cache-from: type=gha
cache-to: type=gha,mode=max