Skip to content

Commit ed7b686

Browse files
committed
Replace workflow with docker build file
1 parent 89d598d commit ed7b686

3 files changed

Lines changed: 36 additions & 115 deletions

File tree

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: docker-build
2+
on:
3+
push:
4+
5+
env:
6+
IMAGE_NAME: minio-docs
7+
8+
jobs:
9+
push:
10+
runs-on: self-hosted
11+
permissions:
12+
packages: write
13+
contents: read
14+
15+
steps:
16+
- uses: actions/checkout@v5
17+
- name: Build image
18+
run: docker build . --tag $IMAGE_NAME
19+
- name: Log in to registry
20+
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
21+
22+
- name: Push image
23+
run: |
24+
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME
25+
26+
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
27+
28+
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
29+
30+
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
31+
32+
[ "$VERSION" == "main" ] && VERSION=latest
33+
echo IMAGE_ID=$IMAGE_ID
34+
echo VERSION=$VERSION
35+
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
36+
docker push $IMAGE_ID:$VERSION

.github/workflows/makefile.yml

Lines changed: 0 additions & 54 deletions
This file was deleted.

.github/workflows/pr-ci-cd.yml

Lines changed: 0 additions & 61 deletions
This file was deleted.

0 commit comments

Comments
 (0)