Skip to content

Commit

Permalink
ci: fix push to github docker registry (#1108)
Browse files Browse the repository at this point in the history
* fix: ci push to docker registry

* ci: upgrade gh actions

* ci: cancel jobs if a new one is queued
  • Loading branch information
Fraccaman authored Sep 14, 2024
1 parent 18791db commit fa6ee91
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true

env:
GIT_LFS_SKIP_SMUDGE: 1

Expand All @@ -25,12 +29,12 @@ jobs:
matrix:
images:
- path: "docker/namadillo/Dockerfile"
tag: "namadillo"
tag: "namadillo-main"
- path: "docker/faucet/Dockerfile"
tag: "faucet-interface"
tag: "faucet-interface-main"

steps:
- name: Checkout repo
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
Expand All @@ -42,12 +46,19 @@ jobs:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository_owner }}/namada-interface
tags: type=raw,value=${{ matrix.images.tag }}
- name: Build and Push docker image
uses: docker/build-push-action@v3
uses: docker/build-push-action@v6
with:
context: .
file: ${{ matrix.images.path }}
push: ${{ github.ref == 'refs/heads/main' }}
tags: ${{ matrix.images.tag }}-latest, ${{ matrix.images.tag }}-main
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

1 comment on commit fa6ee91

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.