-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (32 loc) · 1.11 KB
/
docker-publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: IdracFanControl Docker Build and Push to GHCR
on:
push:
branches:
- master # Change this to your default branch if it's different
jobs:
build:
runs-on: ubuntu-latest
steps:
# Step 1: Checkout the repository
- name: Checkout code
uses: actions/checkout@v3
# Step 2: Log in to GitHub Container Registry
- name: Log in to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Convert repository owner to lowercase
id: repo_owner_lowercase
run: echo "REPO_OWNER=$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
- name: Log repository owner
run: echo "Repository owner in lowercase is $REPO_OWNER"
# Step 3: Build the Docker image
- name: Build Docker image
run: |
docker build -t ghcr.io/$REPO_OWNER/idrac-fan-control:latest .
# Step 4: Push the Docker image to GHCR
- name: Push Docker image
run: |
docker push ghcr.io/$REPO_OWNER/idrac-fan-control:latest