Skip to content

Commit

Permalink
feat: enable docker-push on merge to master (#248)
Browse files Browse the repository at this point in the history
Also updates some gh actions
  • Loading branch information
barnabasbusa authored Jun 21, 2024
1 parent f72c7aa commit 8f7ff3f
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions .github/workflows/publish-docker.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Build and Publish Docker

on:
push:
branches:
- master
workflow_dispatch: {}

env:
Expand All @@ -9,7 +12,7 @@ env:

jobs:
container:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
permissions:
id-token: write
packages: write
Expand All @@ -19,16 +22,16 @@ jobs:
steps:
- name: Checkout repository
id: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install Docker BuildX
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
id: buildx
with:
install: true

- name: Log into Docker Hub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.DOCKER_USERNAME }}
Expand All @@ -40,18 +43,18 @@ jobs:
echo "::set-output name=docker_tags::${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${GITHUB_REF##*/}"
- name: Set up Docker Buildx cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build and push Docker image
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.docker_tagging.outputs.docker_tags }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache

0 comments on commit 8f7ff3f

Please sign in to comment.