-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (29 loc) · 905 Bytes
/
docker-publish.yml
File metadata and controls
36 lines (29 loc) · 905 Bytes
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
name: Publish Docker image to GHCR
on:
push:
branches: [main]
permissions:
contents: read
packages: write
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Docker image
run: |
IMAGE_NAME=ghcr.io/${{ github.repository }}:latest
IMAGE_NAME_LC=$(echo $IMAGE_NAME | tr '[:upper:]' '[:lower:]')
docker build -t $IMAGE_NAME_LC .
- name: Push Docker image
run: |
IMAGE_NAME=ghcr.io/${{ github.repository }}:latest
IMAGE_NAME_LC=$(echo $IMAGE_NAME | tr '[:upper:]' '[:lower:]')
docker push $IMAGE_NAME_LC