Skip to content

Commit

Permalink
fix(ci): repair docker build workflow 2 (madara-alliance#301)
Browse files Browse the repository at this point in the history
  • Loading branch information
antiyro authored Oct 2, 2024
1 parent a74068c commit 5e26c82
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,19 @@ on:
types: [published]
workflow_dispatch:

permissions:
contents: read
packages: write

jobs:
build:
build_and_push:
runs-on: karnot-arc-runner-set

steps:
- name: Checkout repository
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
install: true

- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
Expand All @@ -25,15 +26,19 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set Docker image tag
id: vars
run: |
if [ "${{ github.event_name }}" == "release" ]; then
echo "TAG=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
else
echo "TAG=latest" >> $GITHUB_ENV
fi
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/madara:latest
ghcr.io/${{ github.repository_owner }}/madara:${{ github.event.release.tag_name }}
- name: Post successful message
run: echo "Docker image built and pushed successfully"
tags: ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ env.TAG }}

0 comments on commit 5e26c82

Please sign in to comment.